Prove $7\mid x^2+y^2$ iff $7\mid x$ and $7\mid y$ The question is basically in the title: Prove $7\mid x^2+y^2$ iff $7\mid x$ and $7\mid y$
I get how to do it from $7\mid $ and $7\mid y$ to $7\mid x^2+y^2$, but not the other way around.
Help is appreciated! Thanks.

$x^2+y^2 \equiv \mod 7 \implies x^2 \equiv k \mod 7$ and $y^2 \equiv 7-k \mod 7$
And any $a^2 \equiv 0,1,4,2\mod 7$(Why?) $\implies k=0$
