Choosing an advisor and a thesis problem

First and foremost: it is absolutely necessary to choose an area and a problem that you are interested in. Research is hard and challenging work, even in the best possible circumstances. It becomes outright impossible if you don't care about the subject. If, on the other hand, a problem just won't leave you alone until you have sorted it out, if you stay up until wee hours because you can't put down the research paper you are reading, then perhaps you have made a good choice.

Upon admission, all new graduate students are assigned to a faculty supervisor. This initial assignment takes into account your declared research interests, the availability and interest of faculty supervisors, and the supervisor's ability to pay your research stipend (if you are receiving one) from an NSERC or other research grant. However, your initial supervisor does not have to be your thesis advisor. If you decide that you are more interested in another area of research, you should consider switching.

Assuming that you already know which area you want to work in, you still have to choose a specific problem. It should be something that you can realistically expect to resolve, or at least to make progress. (The Riemann hypothesis is not a good thesis question.) On the other hand, it should be challenging enough to push your limits. You should expect to spend a substantial amount of time studying the literature before you can actually make your own contributions. You should not expect immediate results, nor should you be discouraged if you can't solve a problem and have to move on to another one. That's called research. Many mathematicians, including myself, have had the same experience. Quality results can be hard to prove, and that's exactly what makes them valuable.

Your work should be valuable to other mathematicians. This is a point that I can't emphasize enough. You will not be working in a vacuum. Think of it as a market: there may be no direct monetary rewards for your work, but at some point you will be applying for your first job, then for your first research grant, and so on. The successful completion of each of these steps depends on your ability to "sell" your research. Get to know the people who will be buying it. Talk to them. The same people will be instrumental in arranging your first job.

Links to other resources (I will add more as I look them up):