I was trying to prove why $x^5\equiv x \pmod {10}$ for all natural numbers $x$. I saw a proof where they applied Euler's theorem to show this. They said that the totient function for $10$ is $4$. ($φ(10) = 4$). Therefore,
$x^5 ≡ 1^4 \cdot x^1 ≡ x\ \pmod { 10}$
However my question is: This isn't a correct proof is it? Because it requires $x$ to be relatively prime with $10$ for this to work. So it's a partial proof only (it would prove for $1$, $3$, $7$, and $9$ but not for the other $x$'s)?
If this is true, is there a way to generalize using Euler's Theorem to prove for all $x$? Or is there another way to go about doing this proof?