If \(a^2 ≡ a mod p^k\), then \(p^k\) divides their difference:
$$\begin{gather} p^k|a^2 - a \\ p^k|a(a - 1) \end{gather} $$
If \(p^k\) divides both \(a\) and \(a-1\), then it should divide their difference:
$$\begin{gather} a - (a-1) \\ 1 \end{gather}$$
This means \(p^k|1\), which implies \(p=1\), so \(p\) can't divide both. This means \(p^k\) divides only one of them (either \(p^k|a\) or \(p^k|a-1\)).
If \(p^k|a\), then \(a ≡ 0 \bmod p^k\). If \(p^k|a-1\), then \(a ≡ 1 \bmod p^k\).