I'm attempting to work through some of the questions in Whitelaw's "Introduction to Abstract Algebra" but am having some difficulty.
The question is as follows
Show that $\forall n \in \Bbb{Z},$ $n^2 \equiv 0\ \text{or}\ 1 \mod{3}.$ Show further that $$3\rvert(x^2 + y^2) \implies 3\rvert x\ \text{and}\ 3\rvert y.$$ Deduce that there is no solution in $\Bbb{Z}$ to the equation $$x^2 + y^2 = 3z^2$$ except $x = y = z = 0.$
For the first part, I simply let $n = 3k,$ $3k+1$ or $3k + 2$ with $k \in \Bbb{Z}$. Hence,
\begin{align} (3k)^2 &\equiv 0 \mod{3}\\ (3k+1)^2 = 9k^2 + 6k + 1 &\equiv 1\mod{3}\\ (3k+2)^2 = 9k^2 + 12k + 3 + 1 &\equiv 1\mod{3}. \end{align}
For the second part, since $n^2 \equiv 0$ or $1 \mod{3}$, and that the only case in which $n^2 \equiv 0 \mod{3}$ was when $3\rvert n$, it must then be the case that both $x^2$ and $y^2$ are divisible by $3$ for $3$ to divide their sum (else we get that $x^2 + y^2 \equiv 1$ or $2 \mod{3}$). We also know that if $3\rvert n$ then $3\rvert n^2$. Hence, $3\rvert x$ and $3\rvert y$.
I am, however, unsure how to approach the third part.
Thanks for any help!