I am trying to prove this by contradiction. So if $3$ doesn't divide $a$ or $3$ doesn't divide $b$, then the remainder is either $1$ or $2$. I am struggling on what to do next. How do I get the remainder of $a^2$ and $b^2$ for these cases?
Any help is greatly appreciated. Thank you!
$$(3n+2)^2=3(3n^2+4n+1)+1$$ so both $a^2$and $b^2$ have residue $1$ and their sum residue $2$.