0

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.

2 Answers2

2

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$.

user2566092
  • 26,142
1

Hint

  • The only if case is straightforward.
  • The if case: Use the Euclid's lemma.