How can I prove that $n^4=1\pmod 5$ for all $(n,5)=1$.
This what I have been thinking.
The only numbers $n$ can be are
$n=0,1,2,3,4$
If I proceed to calculate mod 5 for each other those number I will get the following
$n=0$, $0^4=0\bmod5$
$n=1$, $1^4=1\bmod5$
$n=2$, $2^4=1\bmod5$
$n=3$, $3^4=1\bmod5$
$n=4$, $4^4=1\bmod5$
But now I have no idea what else to do. Can someone give me a hand.
You have done a "brute force" proof. You have identified that there are finitely many cases, enumerated the cases and shown that the proposition is true in each case. You have completed the proof.
The problem brute force proofs is that they are not necessarily feasible if the number of cases is large, and they do not always generalize nicely.
You could do a proof by induction.
Proposition $n^5 \equiv n \pmod 5$
base case $n = 0$
$0^5 \equiv 0 \pmod 5$
$(n+1)^5 = n^5 + 5n^4 + 10 n^3 + 10 n^2 + 5n + 1$
As all the terms except the first and the last are divisible by $5.$
$(n+1)^5 \equiv n+1 \pmod 5$
Which proves our proposition.
Which would implies that
$n^4 \equiv 1 \pmod 5$ or $n \equiv 0 \pmod 5$
And this gernalizes for any prime $p$
$n^p \equiv n \pmod p$