It's fine to work on any problem, so long as it generates interesting mathematics along the way - even if you don't solve it at the end of the day.
Andrew WilesI carried this problem around in my head basically the whole time. I would wake up with it first thing in the morning, I would be thinking about it all day, and I would be thinking about it when I went to sleep. Without distraction I would have the same thing going round and round in my mind.
Andrew Wiles