I think my DS was probably quite like this. Very able and self-motivated as a little child eg asking why there are only ten numerals when there are so many more numbers and grasping the concept of place value very easily when he was 3. He didn't mind school for the first two years then he got three teachers in a row who didn't get him at all and he had a really hard time. He was in trouble a lot for being dis-organised and having tantrums when other children wound him up. As a teenager all but one of his teachers said how 'disengaged' he was. He got a diagnosis of ASD ( mild) when he was 8, which would probably have made more of a difference to his enjoyment of school if the senior management had taken it more seriously. His primary teachers went on and on about him " having his own agenda". Eg he had to repeat a piece of maths three times because he wasn't setting it out correctly. Despite this he continued to do things his own way. On reflection, after observing him carefully and coming to the same realisation about myself, I came to the conclusion that he is incapable of concentrating on anything he hasn't chosen to do or doesn't see a purpose for.
Also he would appear to be stubbornly refusing to write down his workings, but watching him I honestly think he couldn't write out his workings. It would interrupt his train of thought, or something. It seems that many ASD people have a real need to have things justified before being able to commit to them. He was also hindered by being apparently articulate; excellent vocabulary, but nevertheless having communication difficulties. Eg, the shoe shop assistant who thought he was rude when he didn't answer the question, ' How do those shoes feel'? ( To DS a difficult Q because how to put into words how they felt, boingy and new perhaps) In a classroom this is unhelpful obviously. Is your DS like this at all?
I would celebrate your DS curiosity and ability with him. But also work hard at praising effort and other good qualities such as kindness, patience etc. And encourage him to develop his self awareness and understanding of the way the world works/ value of lots of different personal attributes. Do you have a choice of schools? I ask because my DS' school although considered to be a good school, really didn't suit him. The senior management had zero interest in or understanding of ASD. Also, IMHO there are some teachers who feel threatened by very bright children. Luckily the ed psych advocates for him to get one teacher in particular who was a really good match.
Apologies if ASD isn't relevant to your DS.
I worried about my DS for the same reasons as you. However he has turned out to be a nice young man ( on the whole, he still drives me nuts occasionally) I hope this doesn't sound arrogant, but I honestly think that's partly down to me working very hard to instil in him respect for other people, tolerance of other people's beliefs, good manners and not making a fuss about trivial things. One of my proudest moments was reading that he was very respectful of other people's beliefs in RE. And it was drilled into him that being clever is not in itself useful. And having a gift makes you lucky, not superior to anyone else. Oh lord, the endless discussions about why school had particular rules etc, seeing things from the teacher's POV etc. The very fact of you not valuing cleverness above everything else, while still valuing it will surely protect your DS from developing into an obstinate little horror. You sound to me like a very good parent.
FWIW, my DS did well in his A levels. Not well enough to get onto any course at any uni, but well enough to do almost any course at any uni.