<s>[INST] Why is the last digit of $n^5$ equal to the last digit of $n$? I was wondering why the last digit of $n^5$ is that of $n$? What's the proof and logic behind the statement? I have no idea where to start. Can someone please provide a simple proof or some general ideas about how I can figure out the proof myself? Thanks.
 [/INST] $$n^5-n=n(n^4-1)=n(n^2-1)(n^2+1)=n(n^2-1)(n^2-4+5)$$
$$=n(n^2-1)(n^2-4)+5n(n^2-1)$$
$$=\underbrace{(n-2)(n-1)n(n+1)(n+2)}_{\text{ product of }5\text{ consecutive integers  }}+5\cdot \underbrace{(n-1)n(n+1)}_{\text{ product of }3\text{ consecutive integers  }}$$
Now, we know the product $r$ consecutive integers is divisible by $r!$ where $r$ is a positive integer
So, $(n-2)(n-1)n(n+1)(n+2)$ is divisible by $5!=120$ and $(n-1)n(n+1)$ is divisible by $3!=6$
$$\implies n^5-n\equiv0\pmod{30}\equiv0\pmod{10}$$
</s>