# Difficulty showing “and”

I'm trying to show that $a^2 \equiv b^2 \mod p$ implies that $a \equiv b \mod p$ and $a \equiv -b \mod p$, where $p$ is prime.

Since $a^2 - b^2 \equiv 0 \mod p$, I know that $(a + b)(a - b) \equiv 0 \mod p$. Then either $a + b \equiv 0 \mod p$ or $a - b \equiv 0 \mod p$.

But I don't know how to show that both are true. Could someone give me a hint?

-
It is true that $1^2 \equiv 9^2 \pmod {10}$, but it is not true that $1 \equiv 9 \pmod {10}$ and $1 \equiv -9 \pmod {10}$. Furthermore, it is true that $0^2 \equiv 3^2 \pmod 9$, but it is not true that $0 \equiv 3 \pmod 9$ or $0 \equiv -3 \pmod 9$. Your proof is valid as long as $p$ is prime, but you cannot change the "or" to an "and". – Tanner Swett Mar 13 '12 at 4:04

You can't show both are true, because they aren't both true. (Unless $p=2$ or $a=b=0$.)
Take e.g. $a=1$ and $b=-1$; these aren't equal except in characteristic two.
Hint $\$ It fails, e.g. odd prime $\rm p\ |\ a-b, a+b\ \Rightarrow\ p\ |\ 2a,2b\ \Rightarrow\ p\ |\ a,b$