I'm trying to solve the following question:
Show that If $x^2 \equiv x\bmod p^k$, then $x \equiv (0\:\text{or}\:1)\bmod p^k$ where $p$ is prime and $k$ is a positive integer.
I've managed to get as far as to show that since $p^k|x(x-1)$ then $p|x(x-1)$ and so either $p|x$ or $p|(x-1)$ since $p$ is prime.
This means that there are two cases: either $x \equiv 0\bmod p$ or $x \equiv 1\bmod p$. However I'm not sure how to show that since it's true for $p$, then it is true for $p^k$.
I had one idea, which is to use the theorem mentioned in the title in reverse, but I'm not sure whether the theorem works both ways. For example in the case that $x \equiv 0\bmod p$:
$x = pm$ for some integer $m$, so $x^k = p^km^k$. This means that $x^k = 0\bmod p^k$ and if the theorem works in reverse, I could finalise the proof of the first case by saying therefore that $x = 0\bmod p^k$.
Can I do this?