Let $p$ be a prime. Prove that $x^2\equiv 1\mbox{ mod }p$ if and only if $x\equiv 1\mbox{ mod }p$ or $x\equiv p-1\mbox{ mod }p$.
Number theory lemma - $x^2 \equiv 1 \pmod p$ implies $x\equiv\pm 1\pmod p$