Prove $9\mid (x^2 + y^2) \iff 3\mid x \text{ and } 3\mid y$ Prove: Let $x, y$ be two non-negative integers. Then $9|(x^2 + y^2)$ if and only if $3|x$ and $3|y$.
General format of proving iff statement.
Proof. 
Part 1, proving $p \implies q$ 
Part 1, proving $q \implies p$ 
Therefore, $p \iff q. \qed$
 A: Here's a (very) slightly different approach, presented more to help you with proof-writing than with the math (which I think you understand).
First, assume $3 \mid x$ and $3 \mid y$.  Then $9 \mid x^2$ and $9 \mid y^2$, so $9 \mid (x^2+y^2)$.  That proves $\Leftarrow$.
Conversely, assume $3 \nmid x$.  Then $x^2 \equiv 1 \pmod 3$.  Since $y^2 \neq 2 \pmod 3$ (no matter what $y$ is), this means $x^2+ y^2 \neq 0 \pmod 3$ so $9 \nmid (x^2+y^2)$.
Finally, if $3 \nmid y$, then we've just proved that $9 \nmid (y^2+x^2)$, so also $9 \nmid (x^2+y^2)$.  This paragraph and the last paragraph prove $\Rightarrow$.
A: I would use a version of your first approach. Mod $3$, the squares are $0$ and $1$. So how could you add two squares and get $0$ mod $3$? Only if both squares are $0$. In which case, $x$ and $y$ are also each $0$ mod $3$.
Note there is no need to consider "$9$". It's enough that $3$ divides $x^2+y^2$. Also, it's not a contrapositive argument. It is just an examination of the four cases $0+0$, $0+1$, $1+0$, and $1+1$.
