I think Markus Redeker's answer captures the essential point. If the problem is hard and famous (at least in the relevant sub-field), so a fortiori for a problem like P≠NP, I would add the further restriction thenthat you should consider attacking it only if that new idea you have allows you to solve an easy or average (but still new) related problem or at the very least allows you to reprove in a completely different way a known result. If this works, then 1) you now know that this new idea is not completely crazy or just a variant of an old one 2) you have a worthy PhD. 3) you can think about making math history. In fact, if you skim through math history, recent or otherwise, you will see that because of point 1) (testing that you idea is indeed new and worth pursuing) many historical breakthroughs were preceded by an easy (or at least much easier) variant relying on similar techniques.