The higher quality the scientific research, the harder it is but also realize that early in ones career, one cannot realistically expect earth-shattering results (and not even later also!) You don't mention how you arrived at the problem you were given. Was it from an advisor? Did you come up with it yourself? If it came from elsewhere it's a lesson on fine-tuning/adjusting your personal discrimination/ parameters/ boundaries. Problem selection is critical. Don't "put all your eggs in one basket". If you are focused on one topic, look at multiple ways to work on it and multiple open problems in that area. Realize that some problems cannot be solved and a big part of the game is developing a personal intuition on which ones can/can't.
Scientific research is fundamentally about the unknown. Especially in TCS even experts routinely admit there are vast swathes of important unknown aspects & even admit to personal frustration/disappointment on that. Look at the "big picture". Despite over a century old, TCS is still a rather young science. In many ways one could build a case and realize that TCS is one of the hardest scientific fields in existence among all scientific fields.
Try reading books/biographies about the historical greats in the field, they all struggled with serious research hardships and setbacks throughout their careers. We also are very lucky to have a very good picture of most of their lives. As Einstein said (in a letter to a child, but widely quoted & taken to heart!)
Do not worry about your problems with mathematics, I assure you that mine are far greater.
And of course there are highly accomplished experts/leaders who are alive right now and writing or even blogging about their research practices and careers! Blogs give an amazingly candid/ personal/ visceral snapshot of research-in-progress/motion that has never before been seen in scientific history. Again we're very lucky to have blogs and brilliant researchers who are willing to spend substantial time on them (this was not the case years ago and many scientists and professionals were justifiably reluctant to go into blogging). Two standouts in particular in TCS, RJLipton and Fortnow blogs which both cover great behind-the-scenes verisimilitude. Another remarkable/inspiring story circulating recently is that of Zhang.
Make sure to socialize with your academic peers at conferences & elsewhere (even somewhat on the internet if possible). You won't feel so alone, you'll see that struggle is an inherent part of the picture. Research is a fundamentally different activity than what precedes it in education, it's about a difficult/challenging shift from the known to terra incognita. The old adage written on centuries-old map regions prior to discovery of the "New World" still applies: here there be dragons.
Maybe somewhat synchronistically, here is a neat paper that has been circulating through many scientific blogs lately, it has caused quite an impact/stir, do a search to see all the reactions to it along the lines, "wow isn't it great someone said that, how I've been feeling". Also am including some other refs that can be helpful in describing the picture.