Let $x, y \in \mathbb Z$. Prove that if $7 | (x^2 + y^2 ),$ then $7 | x$ and $7 | y$ 
Let $x, y \in \mathbb{Z}$. Prove that if $7 | (x^2 + y^2 ),$ then $7 | x$ and $7 | y$.

How do I prove this. Sorry for not providing how I approached the problem because I have no idea how to approach it.
 A: Let $z$ be a number and $k,t\in Z$
then $z$ is a number of the form
$$z=7k\pm1 \implies z^2=7t+1$$
$$z=7k\pm2 \implies z^2=7t+4$$
$$z=7k\pm3 \implies z^2=7t+2$$
The sum of any pair of numbers in these forms is not a multiple $7$
If sum of a pair is divisible by $7$, they are in $7k$ form.
Hence $z=7k$
A: Well, you could if worst comes to worst just try every option:
$x \equiv i \pmod 7$ where $i=0,....6$ and $y\equiv j\pmod 7$ where $0..., 6$.
The $x^2\equiv i^2 \equiv 0, 1, 4, 2\pmod 7$.  (Might be worthing noting that as $6,5,3 \equiv -1,-2,-3$ then $6^2,5^2, 3^2\equiv 1^2,2^2,3^2$).  So $y^2\equiv j^2\equiv 0,1,4,2\pmod 7$.
The possible combinations of $x^2 + y^2$ are $0+0, 0+1,0+4,0+2,1+1,1+4,1+2,4+4,4+2,2+2$ and the only time you have $x^2 + y^2 \equiv 0$ are if $x \equiv 0; y\equiv 0$.
So $7|x^2 + y^2\implies x^2 + y^2 \equiv 0 \pmod 7 \implies x,y\equiv 0 \pmod 7\implies 7|x, 7|y$.
That was pretty clunky and tedious but it's valid.
.....
Alternatively:  $x^2 + y^2 \equiv 0\pmod 7$
$x^2 \equiv -y^2 \pmod 7$.
If $A = \{[x^2]_7|$ where $[x^2]_7$ is an equivalence class of a perfect square $\mod 7\} = \{[0]_7,[1]_7,[4]_7,[2]_7\}$ and if $B =\{-[y^2]_7\}=\{[0]_7,[6]_7,[3]_7,[5]_7\}$ then as $x^2 \equiv -y^2 \pmod 7$ we must have $x^2, y^2$ both in the intersection of $A$ and $B$ and the intersection of $A$ and $B$ is $[0]_7$ so $x^2\equiv -y^2 \equiv 0$ and therefore $x \equiv y \equiv 0\pmod 7$.
.....
I thought maybe there'd be something clever with $(x+y)^2 \equiv x^2 + 2xy + y^2 \equiv 2xy\pmod 7$ and if we assume $2xy\not \equiv 0\pmod 7$ but.... That doesn't seem to get anywhere.
......
It might or might not be worth noting a lemma that if $n|x^2 + y^2$ then $[x^2],-[y^2] \in \{[a^2]_n\}\cap \{-[a^2]_n\}$.  Or $x,y \in \{a| \exists b: a^2 \equiv-b^2\pmod n\}$.
If $p$ is an odd prime the intersection is $0$ so if odd prime $p|x^2 + y^2$ then $p|x$ and $p|y$.  Even if $n$ isn't prime the intersection of those sets of classes is pretty exclusive.
