Can I conclude there's no $x/y$ such that $(x/y)^2=-1$ mod 3 Suppose $x^2+y^2=0$ mod 3. I want to show 3 divides $x$ and $y$. Assume $(y^2,3)=1$. Dividing $y^2$ gives $(x/y)^2=-1$ mod 3. Here I want to use the fact that $-1$ is not congruent to any square mod 3, but $x/y$ is not necessarily an integer. I wonder if I can use this fact here.
 A: If $3$ divides $x$ then $3$ has to divide also $y$. Fine.
Otherwise $3$ does not divide $x$. It means that $3$ does not divide also $y$. It implies that there exists the multiplicative inverse of $y$, let us call it $z$, i.e. $yz \equiv 1\pmod{3}$. Let us multiply the original equation by $z^2$. We obtain
$$0\equiv (0z)^2 \equiv (xz)^2+(yz)^2 \equiv (xz)^2+1\pmod{3}$$
It implies that there exists an integer $a=xz$ such that $a^2 \equiv -1\pmod{3}$. This is impossible.
A: You can't divide $y^2=1$ mod $3$ through by $x$ unless $x$ is not $0$ mod $3.$ And if you do that in that case, you would get $(y/x)^2=(1/x)^2$ mod $3$ which is not going to get the answer. It's easier just to work with the three choices $x=3k,\ 3k+1,\ 3k+2$ and similarly for $y$ and just calculate $x^2+y^2$ in each case, and show you never get a multiple of $3$.
A: You're right that since $\frac{x}{y}$ may not be an integer, it is not valid to divide by $y$.  However, you can use the same kind of reasoning to (with minor modifications):
Suppose $x,y$ are integers so that $x^2 + y^2 = 0 {\mod 3}$  and $(y^2,3) = 1$.  Then, we also have that
$$x^2 + y^2 = x^2 +(3n+1)^2 = x^2 + 9n^2 + 6n + 1 = x^2 + 1 \mod 3$$
so
$$x^2 + 1 = 0 \mod 3$$
$$x^2 = -1 = 2 \mod 3$$
which we can show is impossible by checking the cases $x=3k,3k+1,3k+2$.
