Lately I’ve been feeling particularly incompetent mathematically, to the point that I question how much of a future I have in the subject.
You should note that even great mathematicians sometimes question their abilities.
Michael Atiyah:
The first year or two of research is the most difficult. There is so much to learn. One struggles unsuccessfully with small problems and one has serious doubts about one’s ability to prove anything interesting. I went through such a period in my second year of research, and Jean-Pierre Serre, perhaps the outstanding mathematician of my generation, told me that he too had contemplated giving up at one stage.
You should note that even great mathematicians sometimes question their abilities. Michael Atiyah: