Depressed graduate student. How does a depressed graduate student go about recovering his enthusiasm for the subject and the question at hand?
Edit: I am not that grad student; it is a very talented friend of mine.
Moderator's update:
The discussion about this question should happen at this link on meta. This page is reserved for answers to the question as stated.
 A: Ryan Budney and Andrej Bauer cover most of what I would say, but I would add:
Spend a couple of hours a week reading some Wikipedia article about a piece of math that you have heard of but don't understand.  Follow the links when you see an unfamiliar word.  You will know more that when you started even if you are still uncertain about parts of it.
I hope you have one or more friends you can shoot the bull about math with.  Then talk to them about the article you read, get into arguments about it, talk while taking a walk with them, and so on.  
A: To elaborate on my earlier comment, "Imagine doing something else and then realize how terrible you'd be at it.", I provide the following quote from A Mathematician's Apology.
"I may add that they are particularly unlikely to present themselves to a mathematician. It is usual to exaggerate rather grossly the differences between the mental processes of mathematicians and other people, but it is undeniable that a gift for mathematics is one of the most specialized talents, and that mathematicians as a class are not particularly distinguished for general ability or versatility. If a man is in any sense a real mathematician, then it is a hundred to one that his mathematics will be far better than anything else he can do, and that he would be silly if he surrendered any decent opportunity of exercising his one talent in order to do undistinguished work in other fields. Such a sacrifice could be justified only by economic necessity or age."
While we're on the subject, you should suggest that the student in question read that book.
Edit: Yes, it's public domain in Canada and available at the bottom of the Wikipedia page in the references. Here's a direct link.
A: You have to ask yourself some basic questions.
1) Perhaps you lost your enthusiasm for a good reason.  Maybe your initial enthusiasm was naive.  Maybe you liked mathematics for unsustainable reasons?   You're likely to go through far larger "down" cycles in the future if you stay in mathematics (we all do, it's a chronic problem in the field) so if you're going to stick with mathematics you have to find some kind of joy you can hold on to, through all kinds of messy situations. 
2) Maybe you really do love mathematics but there's aggravating factors causing problems.  Maybe you're not working on enough easy problems.  Solving easy problems is fun, and if they're the right kind of problems you build up new skills.  This is one of the reasons why I frequent this webpage.  
I had a bunch of issues like (2) as a grad student.  IMO I'm mostly better off for them.  I'm talking about issues like solving a problem (or making progress on a problem) and finding out perhaps way too late that the problem had been solved by someone else.  I found it pretty tricky to balance focus with awareness of what other people are doing. The math arXiv and MathSciNet are excellent resources that help with that. 
Being in a very active place where you can talk to lots of people about various areas of mathematics helps.  Being surrounded by enthusiastic people helps.  Going to small conferences where you get to know people can help.  Talking to people about what you're interested in helps.   Barring external impetus, "computing the daylights out of things" is an excellent fall-back procedure.  I know quite a few very successful mathematicians for which this is one of the main approaches to things.  You start piling up enough computations on things that interest you and you notice patterns -- maybe not what you were looking for, but sometimes of interest to people for reasons you never expected.  Sometimes publishable. :) 
edit: After reading your recent edit I can say I saw some similar things as a grad student.  Sometimes the most talented/bright/whatever grad students have a hard time completing a Ph.D.   Some students have too high expectations of themselves.   They give up because they realize they're not going to prove the Riemann hypothesis -- they want that great big creative insight.   In that regard it's good to ensure such grad students are working on both big hard problems and medium-sized publishable work, so that they can complete a Ph.D even if they never prove the Riemann hypothesis or whatever.  Basically, always make sure you have a managable goal in sight.  If your goals are only huge enormous things, you're setting yourself up for a potentially horrible failure.  On the other hand, some people want that kind of situation, and if they're conscious of it, IMO you might as well let them be.  It's their life.  If they prove a major theorem, we're all the better off for it.  If they don't, well at least they tried. 
A: Take a break from math. A semester or quarter spent working a regular job might be a good thing. If your friend can't keep from thinking about math, then they should stick with it in some form or other--possibly a field that can leverage considerable mathematical sophistication but is not mathematics (e.g. economics, computer science, etc.). Otherwise they should reconsider. 
A: google suggests that to guard against burnout:


*

*Be sure to get regular exercise

*Eat well.

*Maintain hobbies and interests
outside of work

*Take time for social activities

A: There are several different approaches you can use. As mentioned, health is important and you should go to the gym or exercise in some way, preferably with someone. Also reading about a variety of topics is also good. In that domain I recommend you read a history of mathematics, and in particular biographies of mathematicians. Some of them have lived very interesting lives and can be an inspiration. Norbert Wiener's "I Am A Mathematician" and Halmos's "I Want To Be A Mathematician" are two examples.
However, when it comes down to doing something for a long time, and especially something so intense like mathematics, you have to keep it fun. You can't take it too serious. Once you do that, you'll just poison yourself with self-destructive thoughts. "I'm not good enough" will only bring you down. The mind is capable of amazing things but you'll never realise your potential unless you start practising mathematics with a light heart. That can be particularly frustrating if you've just entered graduate school and you start to interact with people around you that are often faster and more knowledgeable than you. However, that does not negate the fact that there is enough mathematics for everyone, and that if you work hard enough and long enough in your own field, chances are you'll be able to do some interesting mathematics too.
Math is also a social activity. It's not something to be practised by one's lonesome in a dark room, and although isolation can help when working through problems, you should always return and talk about it with others. Pick the right people as well. Find the right professor or the right group of students who will bring you up and not enervate your soul. Whatever you learn you should release. It's not good to keep your math trapped inside you. Let it out to others and help others. Volunteer in the undergrad math help room(s) if such a thing exists.
Math is a field of logic but it's also an art. Don't always focus on mere logic and correctness. Rigour and proof is fundamental in mathematics, but once you have that, ask yourself, what is beautiful about this? Make the mathematics you do an art to be admired by yourself and by others. 
A: I find it helpful to always work on more than one project at a time.  When I get stuck, depressed, or disinterested with one task, I can always switch to another. I find that helpful. The projects range from research questions, reading and learning new math, to teaching and programming. There is a danger however, that many projects never get finished (and in fact they do not), but I think that's ok as long as the important ones get finished.
A: We're all approaching this from the perspective that the correct thing for your friend is to stay in mathematics. Perhaps not. I think of three very talented friends who eventually left mathematics. One left to become a successful orthodontist, another actually got his Ph.D., but decided to become a doctor instead. The third sold all his worldly possessions and took up with the Worker's Party. I have two children in theatre, and I remember the advice they received from faculty at the schools they were considering:"You've got to want this more than anything else." I don 't think mathematics is much different.  Once the desire is gone, one can try to get it back, or consider if it might be time to move on. As a mathematician, I hope your friend finds some way to get back in the groove. Time will tell.
A: Here's my idea: by answering MathOverflow questions one likes.
A: I think people should absolutely ask themselves if they want to be academic mathematicians (the main although not quite only reason for getting a PhD in mathematics).  There are a lot of other things that you can do with the skills to do mathematics.  (The quote from Hardy above is entirely wrong.  Perhaps he can be partly forgiven because he did write it before the invention of modern computers, revolutions in modern medicine, discovery of foundations for a rigorous approach to biology, etc., but I still think the quote was entirely wrong even in 1940.)  Some depression or discouragement is par for the course, but I frankly think too many people are too reluctant to try something new or different and ignore the signals that are telling them they aren't on exactly the right path (which still begs the question of whether they need a 10-degree change in course or 180-degrees).  Mathematicians tend to value that which is hard.  Thus if you are finding it difficult to generate the motivation for what you are doing, that is seen as an additional hurdle to surmount, rather than a signal to set yourself on a course that you are more enthusiastic about and which is therefore easier (and this is not cheating!).
A: A career in mathematical research is fraught with ups and downs. Instead of wavering from phases of elation and depression it is better to adopt a calm and philosophical attitude to do good work in the long run.
 Also, drinking beer once in a while helps.
A: I went through a similar period during my candidature... it's rough - you can spend months stuck on some problem without some other problem to work on.  You can feel like you're doing nothing more than shuffling around commas in a paper (not doing any "real mathematics"), usually not knowing how important your work is (and therefore assuming it's not very important).
My advice is to get out and about, try to get to some conferences etc. and find people who are interested in similar problems.  Give lots of talks -- if there's no way to give regular seminars already, then make it happen yourself.  Talk to people at nearby unis about giving talks there too.  Go through the SpringerLink etc. websites and sign up to receive emails of the tables of contents of related journals.
Perseverance and hard-work will get you there in the end.
A: Theres two potential questions actually going on here (which are both important for those in a university setting to be aware of):


*

*intellectual burn out, in which case something as simple as reading about some range of topics different from the current research focus or forcing weekends to be about rest and some sort of physically demanding hobby (such as indoor climbing) will do a world of good.

*deeper issues than just burnout management, in which case it would be appropriate to at least investigate talking with the on campus mental health staff to figure out how to manage the underlying issues. There are a whole range of mental health issues which only manifest or become obvious in a person's early to mid 20s, and which need professional assistance and/or medication to substantially improve the person's quality of life
A: I went through a depressed period in grad school. I felt I couldn't understand modern algebraic geometry (even after a full year of working through Hartshorne's book!) and thought there was no hope of doing serious research for me (I was interested Number Theory). I dropped out and tried to do other things. After a couple years I found that I loved solving math problems the best. I went back to grad school and had the great fortune of working under a wonderful adviser who always gave me the help I needed to move ahead. I enjoyed and treasured every minute talking with my adviser. Eventually I was able to finish the PhD and graduated. I can say without too much exaggeration that it was my adviser who saved me.
So your friend may just need to search for the right professors/advisers to help him.
A: The stuff at Terry Tao's career advice page is wonderful no matter where you are in your mathematical development -- there are also links at the bottom to other useful career advice.
In particular, the "Advice to a Young Mathematician" section of the PCM contains a wealth of advice on all sorts of things. I was heartened, in a weird way, to learn that even such luminaries as Atiyah and Serre were frustrated enough to seriously think about leaving mathematics when they were around my age.
Finally, I could edit mam's comment, but I don't want to start with a -21 handicap, so I'll add it to my answer. Even if you don't leave mathematics altogether, it's worthwhile to ask if you want to switch focus. Even if you decide to stick with combinatorics/topology/PDEs, you'll gain some valuable insight from learning about another part of mathematics, and discovering for yourself the "little insights" of another field can always boost self-confidence. (Sorry to pimp my own blog; Bollobas says something similar in his PCM section, but then Bollobas always turns out to have scooped me whenever I come up with something I think might possibly be original, so...)
A: There is an interesting article 
Scott Berkun, How to survive a creative burnout
It is not aimed at mathematicians in the first place but still useful in my opinion.
A: Depression is par for the course ... almost. Read the article "Emotional Perils of Mathematics" that appeared in Science, Vol. 149, No. 3687, p.1048, Aug. 27, 1965. After reading that you cannot help but ask yourself, why do we do what we do. So, how is this supposed to help? Well, realizing that it happens to everybody and that you're not that different may help. In particular, there's nothing wrong with you.
A: Whenever the depressed person can, he should take some time off and travel the world. Not enough people travel. Some may be afraid to do so, especially people from the US. (Actually, having grown up in the US, I've never felt safer in 'dangerous Islamic countries.')
There are some very cheap countries in the world, like India, where you can spend about $1 a day for everything you do. And there are very interesting ones, like China and Egypt. In addition to the hundreds of countries in the world, he/she may enjoy China, Egypt, Yemen, or Mexico. I have lived in these four places and can give advice about where to go, what to bring, how to get there, etc. 
