Improving concentration and stamina when solving difficult problems.
Solution 1:
One useful thing to do is not to try and keep everything in your head. If you come up with something nontrivial, write it down. Devise ways to organize the information you have.
e.g. a significant part of the reason why we invent abstract concepts like "vector space" and study linear algebra is that, if we can find a vector space structure in a problem, we can extract a lot of information by forgetting all of the actual details of the problem and look at just the vector space and understand it through linear algebra.
One of my favorite problem solving exercises involved taking a problem and proving that its solutions were essentially the same thing as the solutions to some other problem. Then I promptly forgot entirely about the original problem and started solving the new one.
I then found a third problem whose solutions were essentially the same as the solutions to the second problem.
Finally, I forgot entirely about the second problem, and proceeded to work out the solution to the third problem as it was in a form I was reasonably sure I could solve directly.
I actually find this sort of thing -- the ability to take one problem, extract some key facts, then abstract away the details of the original problem to present a new, simpler problem whose solutions tell you something about the original problem -- to be one of the most important tools a mathematician has.
Solution 2:
If you get distracted, it might just be that the problems don't get you interested enough. Try other sources of problems. Sources of good problems aren't easy to come by. One of my professors gave weekly homework, and somehow he almost always came up with asking to prove something to which our first reaction was "this can't possibly be true!"
You might be trying to solve too many too hard problems, it is bad for motivation when success is far in between.
Don't force yourself, when you get stuck do something else. The subconscious works in strange ways, often when looking at the problem a few hours or days later the insurmountable barrier is just gone.