TITLE: How does a mathematician choose on which problem to work?
QUESTION [50 upvotes]: Main question:

How does a mathematician choose on which problem to work?

An example approach to framing one's answer:

What is a mathematical problem - big or small - that you solved or are working on, how did you choose this problem, and why did/do you continue to work on it? 

An earlier incarnation of this question asked also for problem sources, and about finding mathematics questions (and engaging in mathematical research) more generally; hopefully this revised version focuses it a bit more (though already posted answers should be understood as responses to the previous version).
As one example of what a retrospective look at a problem (problems) might look like, see the note (How the Upper Bound Conjecture Was Proved) provided by Richard Stanley in a comment below.

REPLY [21 votes]: I've found that "problem creation by analogy" can be very helpful. In grad school I learned about elliptic curves from many great sources (courses of Mazur and Serre, grad student friends too numerous to enumerate, survey articles by Cassels and by Tate, books by Lang,...) and started working on an elliptic curve problem posed by Lang. And every few weeks I'd go to the library and skim the titles and abstracts of lots of journals. (Nowadays, the ArXiv can serve as a similar source.) And I noticed an article with a new improvement on something called Lehmer's conjecture, which I'd never heard of, but it had something to do with heights of algebraic numbers. So I thought, well, algebraic numbers (more properly, the multiplicative group $\bar{\mathbb Q}^*$) are analogous to points on elliptic curves. So I translated Lehmer's conjecture to elliptic curves and proved a result. (Admittedly, it was rather weak, and Masser and other people had stronger results via different methods; but over the years, I've returned to the problem and have papers with Marc Hindry and with Matt Baker.) Fast-forward a few years, I was at a conference at Union College, where the inimitable John Milnor gave a beautiful colloquium-level talk on complex dynamics. I knew nothing about the subject, but for the first half, which he devoted to a survey of the classical theory (Fatou, Julia, etc.), almost every concept that he mentioned seemed to have an elliptic curve (or arithmetic geometry) analog. Thus orbits of points via iteration of rational maps looked analogous to the Mordell-Weil group of an elliptic curve, points with finite orbits were the torsion points, one could look at integer points in orbits as being analogous to integer points on curves (Siegel's theorem), etc. Pursuing that analogy has lead me, and many other people, to a host of fascinating problems, including 10 PhD theses that my students have written in this relatively new field of arithmetic dynamics.