I too, had the same problem but I changed my mindset and reminded myself of why I love the purest human art form - Mathematics. It's because of its intrinsic beauty.
When I cannot solve a problem, I change my mindset from "I'm so stupid. I can't solve this." to "Wow, this is such an enlightening proof, trick, application, union of two ideas, etc." Just like someone commented before me, I add it to my mathematical toolbox which prepares me further. I don't get angry with myself for not getting an answer anymore than a young film maker would be angry with himself for not making The Godfather.
I look at Mathematics as something bigger than myself as a place where I can just admire and learn from elegant ideas. I, no longer, think I have a point to prove to myself or to anybody else so I don't think of mathematics as an arena to prove my intellectual mettle anymore. I think of it as a gallery I visit as an eager spectator. Each visit prepares me to appreciate the next visit better and, on occasion, add something to the gallery.
I also maintain a book of elegant results and proofs that I thought manifested out of nowhere. Not only do I record the question and the answer, but I also note down exactly what I found elegant about it and why I like it. Soon, you'll find yourself admiring proofs and finding links you didn't see before.
You don't have to go to very sophisticated waters to find such results. Elementary mathematics is full of them. (Heron's problem, for example.)