I am a 5th MSc semester mathematics student at a local German university. Since fall, I have been working on my thesis, which is the only remaining task for finishing my studies.
I had not had particular difficulties during my studies, apart from the usual struggling and doubts I suppose every student undergoes: before my masters studies, I had spent 7 semesters at another university on two BScs in physics and mathematics. I am paid by a public scholarship. I had decided to change the university for my master's half for personal reasons and half in order to have a greater choice in courses held. My average score is 1.5 at the moment, which also had been my final score for the two BScs.
Now that I have started my thesis, nearly everything has changed: I am working with a professor whose courses I took several of, all with good grades, so she did not object to supervising my thesis. Although I have not had severe problems with my studies before, I am getting nowhere with my work now:
For understanding a single paper I am supposed to work on I sometimes need weeks, let alone the questions posed to me to think on, which I sometimes spend weeks without any serious results I could present. I have the impression that I am lacking creativity, intuition and a sufficient knowledge which I think I should have acquainted during my courses.
My problems have driven me into particular personal problems: I have lost contact with most of my former colleagues I used to spend every weekend with, partially because they seem to have lost interest in spending time with me, and partially because my mind is governed by thinking of my inferior scientific performance and the conviction no one wants to have to do with such a poor student. I cannot enjoy leisure time since I permanently have to think of the open problems that haven't worked out over a long time. I cannot claim to have chosen a university where I am competing with the best.
For 1½ months I have been taking antidepressives and having psychotherapy, which barely helps to soften the biggest peaks of auto-aggression and contemplating self-harm, but have not yet helped me to find another view on what I'm doing.
TL;DR
Although my university performance seemed sufficient for me not to worry much about it, starting working on my master's thesis has revealed a vast lack of mathematical knowledge and poor mathematical working capabilities. The longer I work on it, the more I lose any self-esteem.
Question: Where should I have foreseen my problems? Which signs did I ignore? Where did I miss to put things on the right track? And: how shall I find value in myself, now that I have found myself incapable of pursuing research, and have lost everything else?