I keep forgetting what I've learned. Should I even consider pursuing advanced degree in math? This is my first time posting here, and I'm not very sure whether I should post this in Academia or Math stackexchange.

Currently I am a Mathematics/Economics major. I have been taking a lot of math courses and I really liked them. But usually after I was done with the final, I would forget most of the details. For example, I took two courses on mathematical analysis and I got A on both of them. But right now if someone asks me to do one of the homework problems, it's very likely that I would get stuck. 

Right now I am taking differential geometry and there are lots of analysis and linear algebra things going on. Sometimes I try to prove a theorem, but then because I forgot some important theorems from linear algebra, I just couldn't prove that theorem of geometry.

My question is, if I'm about to pursue an advanced degree in mathematics, am I expected to know all the theorems and their detailed proofs? If so then probably I should really spend more time reviewing all the things that I've learnt. Or is it like I am expected to be good at one certain subject (like analysis)? Thank you very much.
Your question reminds me of this question on quora, which is about physics, but is pretty relevant to math as well. To summarize the many good answers there, no, you're not supposed to remember every single detail of everything you learned in college (ok, I guess there are people with eidetic memories, but not every person with an eidetic memory is in research, and not every successful person in research has an eidetic memory). If you learned something well, as in understood it and didn't just memorize it, it will come back to you when you need it (and it will take less time to understand it the next time). 

In fact, preparing for the math subject GRE, which you should take if you are planning on graduate school in mathematics in the US, was really helpful for me to recall a lot of the information I had managed to forget as an undergraduate. It also made a lot of connections between fields clear to me. (Of course I have now forgotten it all again!) 

Mostly, you should aim to remember the major theorems, and a general idea of how they are proved and how it fits into the 'big picture'. It is okay to not remember every single detail of every proof. 

Usually one spends the first year of a PhD program in mathematics taking courses in a number of areas (algebra, analysis, and topology where I went to grad school), and then one is expected to pass qualifying exams based on those first-year courses -- the advanced students who already know the material for these courses coming in will likely get the opportunity to take the quals early. In some sense the idea here is that regardless of what your thesis eventually turns out to be, every math PhD student should know about, say, the fundamental group, or Grobner bases. After passing quals, one tends to become more and more specialized, usually this means we forget a lot of what the first-year courses covered, but again, since we learned it well enough to pass quals once, this means that in research you get a sneaking suspicion like 'this smells like covering spaces', and then you go back and remind yourself of all the stuff about covering spaces you had learned back in the day. 

Anyway, the point is that at least at the beginning of a graduate program you are expected to learn a number of things in a number of areas, and most likely demonstrate this by passing qualifying exams of some form. Then as you get more specialized, many things get forgotten, but you usually remember enough to know where to look things up when needed.