What type of integer $n$ do we have if $a^2 ≡ b^2 \pmod n ⇒ a ≡ ±b \pmod n$ ?
Proposition 3.14(b) which states that if $p$ is prime, then $a^2 ≡ b^2 \pmod p \iff a ≡ ±b \pmod p$.
So if $a^2 ≡ b^2 \pmod n$ and $n$ is prime, then $a ≡ ±b \pmod n$.