Prove that if $a^2\equiv b^2\pmod m$ then $a\equiv b \pmod m$ or $a\equiv-b \pmod m$ Prove that if $a^2\equiv b^2\pmod m$ then $a\equiv b \pmod m$ or $a\equiv-b \pmod m%$
since $a^2\equiv b^2\pmod m$
then $m\mid a^2-b^2$ and $a^2-b^2=mc$ for some integer $c$.
I am not really sure where to go from here and was thinking maybe to use contradiction?

$a^2 \equiv b^2 \pmod{m}$ means $m|(a+b)(a+b)$.
It does not mean that $m|a+b$ or $m|a-b$. (This happens only when either $\gcd(m,a+b)=1$ or  $\gcd(m,a-b)=1$).
And hence generally we cannot say $a\equiv b\pmod m$ or $a \equiv -b\pmod m$.
