How to show that if $9n^2=a^2+b^2$, $a$ and $b$ are multiples of $3$ To be honest, I don't know where to start with this problem:
Let $n\in \mathbb{N}$. Prove that if $9n^2$ is the sum of two perfect squares $(a^2,b^2)$, then $a$ and $b$ are multiples of $3$.

Taking $9n^2=a^2+b^2$ modulo $3$, we get $$0\equiv a^2+b^2\pmod{3}$$
Now, mod $3$, we have $0^2\equiv 0, 1^2\equiv 1, 2^2\equiv 1$.  The only way two of these sum to $0$ is $0+0$, so $a^2,b^2$ are both equivalent to $0$ mod $3$.
Hence, $3|a^2$ and $3|b^2$.  However, $3$ is prime, so in fact $3|a$ and $3|b$.
