Let $a, b$ be non-negative integers and $p\ge3$ be a prime number. If $a^2+b^2$ and $a+b$ are divisible by $p$ does it mean $a$ and $b$ are always divisible by $p$?
Suppose $p$ be an odd prime.
Note that $a^2+b^2=(a+b)^2-2ab$ and use Euclid's lemma to conclude that $p$ must divide $a$ or $b$.
Now, assume that only one of $a,b$ (WLOG say $a$) is divisible by $p$.
Since $p\mid a+b$ and $p\mid a$, we get $p\mid (a+b)-a=b$, i.e., $p\mid b$, a contradiction.
Since $a+b\equiv 0 \bmod p$, we have $a\equiv -b $ and thus $ a^2\equiv b^2 \bmod p$.
Then $a^2+b^2\equiv 2a^2 \equiv 0 \bmod p$ and since $p>2$ we know $p\mid a^2$ and thus $p\mid a$ and $p\mid b$.