Here is some advice from the late, great Australian mathematician Greg Hjorth.
(I was lucky enough to attend what turned out to be his last seminar, a semester on descriptive set theory, at the University of Melbourne in 2010.)
This originally appeared on his website at UCLA -- but I couldn't put it better myself (although it has been edited for content).
(i) Doing a PhD in an area of research that you love can be one of the most positive and uplifting activities in life. Not everyone does it, but it is one of the truly worthwhile things you can do for the brief spell on this planet. However, I cannot sugar coat the economics. The simple fact is that most people who complete a PhD in a pure research area (such as pure math, philosophy, theoretical physics, history, literature, and so on) will never gain full employment in their area of study. Do not do a PhD in the expectation of it being a valid career path, parallel to engineering, medicine, or an apprenticeship. Only do it if you have a deep desire to pursue the research and see it as having a transcendant value.
(ii) On a related note, doing a PhD for 4-7 years and then being unable to find a job in academia is not the worst possible outcome. The difficulties start in the case you do find a temporary job or postdoc. I have seen cases where people shuttle between one short term job and then another, only to eventually see the jobs dry up at some point in their 40's, at which point they are largely unemployable. If you finish the PhD, and you get a temporary job offer, now is a very good time to think long and hard, in the most cold blooded way possible, about your economic future.
(iii) For students who want to work specifically with me, I ask that they make some effort to find out about my research area before hand. Although I am not necessarily completely opposed to taking on a student outside of my areas of expertise, I am wary of it. Given the commitment involved in pursuing graduate work, you want a recognized world expert as your advisor -- without that there is certainly a lot less help in the technical support, but also there is the risk of spending a lot of time proving a result which the experts consider trivial or uninteresting. If I ever were to have a student who absolutely wanted to work with me (e.g. for geographical reasons) but not in my core areas, then I would probably try to arrange a co-supervisor in the specialization.
(iv) One of the huge differences between graduate and undergraduate education is the intensity in which one needs to learn the material. As an undergradute, it is mostly fine to learn material well enough to keep it together until the next exam. It is often not necessary to truly understand the material to its core. A PhD, on the other hand, involves learning to the point of being competitive with the leaders in the field -- or at least, doing something which they would consider interesting and worthwhile. From time to time there is a student who is such a genius they step off the plane and make a sudden advance. For the rest of us, for the 99.9 percent of the human race outside this exceptional category, the process through to becoming an expert is similar to the process of becoming a concert musician, or fluent in a foreign language, or an outstanding athlete. Constant training and even a certain amount of repetition -- going over things you thought you understood, trying to understand standard proofs in a new way, and so on.
(v) On a related point, people sometimes underestimate the extent to which apparently novel and even revolutionary research is based on simply developing a deeper understanding of the work from before. Everyone remembers Newton's quip about standing on the shoulders of giants -- what people often don't realize is the profound efforts Newton made to understand Kepler's work in a way it had not been understood before, and that even "Kepler's three laws" were in fact Newton's carefully constructed isolation of the most valuable ideas among a sea of calculations and speculations. For a young person who wants to become a leading researcher, I would recommend that before anything they try to understand the work of the predecessors in their own research specialization as well as possible -- in fact, try to develop their own understanding.