I would like to find the number of different equivalence classes for $\{(x,y)\mid x^2\equiv y^2$ mod $3 \}$ on $\mathbb{N}^2$. I would just set $x^2$ to $0$ or $1$ or $2$ or $3$. For example mod($0$,$3$)=$0$, mod($1$,$3$)=$1$, mod($4$,$3$)=$1$ which would brings me to two classes. However, the solution seems quite different and I just dont get it:
mod(($3x)^2,3$)=mod($9x^2$,$3$)=$0$
mod(($3x+1)^2,3$)=mod($9x^2$+$6x$+$1$,$3$)=$1$
mod(($3x+2)^2,3$)=mod($9x^2$+$12x$+$4$,$3$)=$1$
May I ask for some assistance. Thank you in advance!