<s>[INST] Let $X$ be a set of primes $p$ so that $5^{p^2}+1 \equiv 0 \pmod {p^2}$ Which of these sets is $X$ equal to? $5^{p^2}+1\equiv 0\pmod {p^2}$
$1.$ $\emptyset $
$2.$ {$3$}
$3.$ All primes of the form $4k+3$
$4.$ All primes except $2$ and $5$
$5.$ All primes
This one is pretty easy to get right through the process of elimination, which is how I solved it (it's $3$). What would be a more rigorous way of solving this?
 [/INST] In the congruance holds you also have : $5^{p^2}+1\equiv 0 [\rm mod p]$. 
On the other hand $5^p\equiv 5 [\rm mod p]$ ($equation : x^p \equiv x [\rm mod p]$) so we should have $5+1\equiv 0 [\rm mod p]$  (apply equation twice). 
So the only possible primes are 2 or 3. 2 is not a solution and 3 is a solution indeed:
$$5^4+1 \equiv (4+1)^4+1 \equiv 2 [\rm mod 4]$$ 
$$5^9+1 \equiv (9-4)^{9} +1 \equiv  -(4)^{9} +1 \equiv -(8)^6+1 \equiv -1(-1)^6+1 \equiv 0 [ \rm mod 9] $$. 
Hence 3 is the only solution
</s>