A small anecdote: my dad is a mathematician. For a significant portion of his postdoc/early career (in the 80's/90's) he worked on proving a particular conjecture. Eventually he abandoned it and went to be much more successful in other areas.
A few years ago someone found a counterexample. He was quite depressed for a few weeks at the thought of how much of his strongest research years had been devoted to something impossible.
Choosing a "good first problem" in math is quite difficult. It needs to be "novel," somewhat accessible, and possible to solve (which is an unknown when you're starting out)!