Prove that $a^2 \equiv b^2 \pmod q$ if and only if $a\equiv\pm b \pmod q$ for any prime numbers $q$
homework question, please help.
Prove that $a^2 \equiv b^2 \pmod q$ if and only if $a\equiv\pm b \pmod q$ for any prime numbers $q$
homework question, please help.
If $q$ divides $a^2 - b^2 = (a-b)(a+b)$, then $q$ must divide either $a+b$ or $a-b$ because $q$ is prime. This gives $a = \pm b \hbox{ mod } q$.