Memo to self: when attempting to prove a theorem, and it just doesn’t seem to be working; don’t forget to search for counterexamples. The theorem may not actually be true.
Even if the theorem is a previously known result that has been verified repeatedly by many mathematicians over decades, it’s still possible that I have misremembered what the theorem actually says, and am attempting to prove a variant that is in fact not true. In particular, it is possible I have misstated the conditions under which the theorem holds. E.g. I am attempting to prove a result true for continuous functions that actually only holds for differentiable functions.
And as a corollary to that, it is all too common that the statement of a theorem in a textbook problem or an exam isn’t quite correct; and that what’s presented as “the well-known Bloggs’ Lemma” is in in fact not quite Bloggs’ Lemma after all. (Physics texts are notoriously bad here, since they routinely ignore qualifications such as “except on a set of measure zero.”)
And finally, even if the theorem is in fact true, the attempt to construct a counterexample may suggest alternative approaches to proving it.