I have a past exam question that I proved as follows: $$(\forall n\in \Bbb Z)\bigl((3n^2-5\equiv 2 \pmod 4)\lor(3n^2-5\equiv 3 \pmod 4)\bigr)$$ If odd: $$3n^2 - 7 = k4,k\in \mathbb Z$$ $$3(2l+1)^2 - 7 = k4, l\in \mathbb Z$$ $$12l^2+12l-4 = 4k$$ $$3l^2+3l-1=k$$
If even $$3n^2 - 8 = k4$$ $$3(2l)^2 - 8 = k4, l\in \mathbb Z$$ $$12l^2 -8 = 4k$$ $$3l^2-2=k$$
$$\therefore \forall n \in \mathbb Z, 3n^2 - 5 \equiv (2\mod 4) \lor (3 \mod 4)$$ Is this a sufficient proof for this question? Any tips to improve?
Edit: Also I feel like I got lucky with the whole even or odd thing, and I don't want to rely on that in the exams, how do people determine how they are going to attack this sort of problem? Or is it a matter of lots of practice?