Is there a way out of losing interest in science during a PhD?
You show strong signs of burn-out. It is unclear whether you really lost interest in science or you simply did not make the proper transition from being motivated by the triggers of your youth (winning competitions) to the triggers of scientific endeavour on its own.
Also note, competitions are fun, because they are hard, but solvable in limited time. Full Metal Science, however, is tough. You have no idea whether things work, whether there is a solution and, if there is, how long it takes. It's a completely different game. It's a 100-m sprint vs. a marathon.
There are a couple of ways out. If you can afford to, you should take time off for a few months, even half a year and do other things. Stuff you enjoy, sleeping, traveling, gaming, whatever, without pressure. Forget science for that period. Then, but only then, after your return, come back and take account of what really makes you tick. What is it that you would like to be doing for the next 5 years? Not your lifetime, just 5 years. And move from there.
If you cannot afford to go away for a few months, there is something else you could try, namely starting a scientific hobby. Take a bit of time apart where you do something that is PhD-irrelevant. Solving problems? Hacking some software? Or something entirely different. Make yourself clear that this does not have to be published, it's just something to keep you aware about what you enjoyed about science. There is Feynman's anecdote about the wobbling plate, very pertinent to you. In any case, absolutely make sure to hard-limit your PhD hours per day. Make sure you keep a hobby, and a network of people etc. It sounds like a waste of time, but it isn't. Your other hours will count more if they are boxed in.
TL;DR:
- Take time off.
- If not possible, find a scientific hobby and hard-box your PhD hours.
- Keep your other activities on plan, almost without exception (except for isolated important deadlines).
PS: I have no advice concerning your mentioning of hypersensitivity concerning feedback from others. That's not really a question we can answer here, and some people's advice would be almost automatically to recommend therapy. I am not saying this is not the right step, but some people find this overkill. If validation of others plays a bigger role for you than the topic itself, you probably need to consider activities which get you this validation more directly by interacting with people, such as blogging, science journalism (if science interests you at all anymore, that is).
While burnout is a common enough reason for what you experience as stated by Captain Emacs, there is another possibility.
Part of your description seems to imply that you sort of coasted through your education until recently, never having to work hard at it. Perhaps you have just reached your natural level of learning and are now discovering that you do, in fact, need to really work. Not your "maximum" of course, and there isn't a word I know that is better than "natural". I hope you get the idea.
I was lucky enough to reach my level rather early (secondary school). I was once told, after some sort of general test that I should "aspire" to a junior college education but would probably be less successful in a full bachelors program. It made me mad enough that pushed myself to succeed and wound up with a math doctorate. My sister, on the other hand cruised through, always showing me up. But she quit early when it finally got hard for her, though she is very bright.
For burnout, the solution is as suggested in the other answer quoted. But for reaching your level and still having the desire to continue the solution is to find more effective, methodical, ways of learning. For me it was doing all of the problems in the textbook, not just the ones assigned. It may not mean longer hours, but more effective study. Taking more and better notes. Summarizing your notes. Seeking insight, asking questions of everyone. Noting their answers. Not assuming that you have learned something because you saw or heard it or read it once.
I had the advantage of having one goal: to be an academic mathematician. I drove to that goal pretty relentlessly, though did also suffer a burnout episode that set me back. But learning early that I had to work to learn was a big help.
I wonder if your sense of lack of validation is related to this issue. You are no longer the golden one. You are surrounded by your peers not your inferiors. That may be a new sensation for you.
Use the lack of validation as a motivator. When I look back over my research career so far, beginning with my PhD (in Mathematics), I often wonder if I would have been as successful without the painful criticisms along the way. I can point to at least 3 professors and a few co-workers who openly doubted my abilities and were sometimes very nasty about it. I think that subconsciously I used this as motivation to succeed in order to prove that they were wrong.
I imagine there are a few certifiable geniuses like Terence Tao who never experienced this doubt from others, but generally I think that most successful research is a product being hard-headed, developing a thick skin, and putting your nose to the grindstone. Of course it helps to have a particular subject that you are passionate about, and it sounds like this may also be your issue. Since nothing other than mathematics is interesting to you, I would look into some other areas of mathematics until something piques your interest. What your advisor wants you to do may not be best for you, and it is easy to become burned out when working on other people's problems that you really don't care about. This was my case as well, so I began working on problems in a tangentially related field, and that is where I found my success. I found the small part of math that I enjoyed, and made everything work out through sheer tyranny of will. There is a kernel of truth in the saying "Find what you love and let it kill you".