The title says it all.
I often heard people say something like memory is unimportant in doing mathematics. However, when I tried to solve mathematical problems, I often used known theorems whose proofs I forgot.
Some of you may think that using theorems whose proofs one has forgotten does not seem to support importance of memory. My point is that it is not only useful, but often necessary to remember theorems(not their proofs) to solve mathematical problems. For example, you can’t solve many problems of finite groups without using Sylow’s theorem.
I think all of us at some point will invoke theorems whose proofs we have forgotten. I would argue that memory is important for mathematics in the sense that it is important for practically every other field.
Certainly having good memory will not hurt you and several mathematical giants were undoubted aided by their prodigous memories (notable examples that come to mind include Euler, Poincaré and Von Neumann). But as is always said for mathematics, it is more important to understand and particularly the connections between subjects.
I don’t think many people can hope to retain absolutely everything they learned, even for undergraduate mathematics. Instead what is important is the ability to rapidly recover what you have lost. If you learn a subject and subsequently forget about it, then you should be able to relearn the subject much faster on a second exposure. In fact, I would argue that it is these repeated re-exposures which ultimately contribute to your mastery of a subject.
What’s more important than memory would be the ability to efficiently find relevant literature. If you forget a theorem, but through your understanding and experience subsequently find it in some book or journal then you may have lost a bit of time, but ultimately you have your result.
Should you be discouraged from going into mathematics if you have a poor memory? Well that depends. If you fail to remember your own name then I would indeed say that mathematics will be a struggle to you. So will life in general. But if your memory is average, or even slightly below-average, then I would say that you will do just fine. Mathematics is ultimately not as memory-intense as subjects such as history or medicine.
P.S. In this question here, there is an interesting comment by Bill Cook about this subject. Of course I didn’t remember the comment word for word, but rather just remembering the content roughly was enough for me to recover it. The ability to find is as equally as important as the ability to retain.