Show that $x^2 \equiv 1 \pmod p$ implies $x \equiv 1 \pmod p$ or $x \equiv (p-1)\pmod p$ for every prime $p$.
I understand one might be able to prove on of the converses but I have no clue as to how to proceed with it and any help would be really appreciated.
If
$x^2 \equiv 1 \mod p, \tag 1$
then
$(x - 1)(x + 1) \equiv x^2 - 1 \equiv 0 \mod p; \tag 2$
therefore,
$p \mid (x - 1)(x + 1); \tag 3$
now since $p$ is prime we have
$[p \mid (x - 1)] \vee [p \mid (x + 1)]; \tag 4$
if $p \mid (x - 1)$, then
$x - 1 \equiv 0 \mod p \Longrightarrow x \equiv 1 \mod p; \tag 5$
if this fails, that is, if $p \not \mid (x - 1)$, then we must have
$p \mid (x + 1) \Longrightarrow x + 1 \equiv 0 \mod p \Longrightarrow x \equiv -1 \mod p. \tag 6$