[Math] Linear congruence proof, show congruence has exactly two incongruent solutions

congruenceselementary-number-theory

Let p be an odd prime and k a positive integer. Show that the congruence $x^{2}$ $\equiv 1 \ mod p^{k}$ has exactly two incongruence solutions, namely, $x \equiv \pm 1\mod p^{k}$.

I'm not sure what to do after this:
$x^{2}$ $\equiv 1 \ mod p^{k}$ => $p^{k}$ | $x^{2}-1$=(x-1)(x+2)

Best Answer

As you have already observed, $p^k\mid (x-1)(x+1)$. In particular $p\mid (x-1)(x+1)$, so either $p\mid x-1$ or $p\mid x+1$. In any case, we cannot have both since $p\not\mid 2$. This implies that $p^k\mid x-1$ or $p^k \mid x+1$. Why?

This works in general: $x^2=n\mod p^k$ has at most two incongruent solutions.