Proving $8 | x^2 + y^2$ iff x,y are both even is false

discrete mathematicsproof-verification

Per the question above I am trying to prove this statement false. As such only one of two conditions have to be met both x and y being odd, or them both being odd. I've seen a lot of examples on this site regarding x^2 – y^2 for a similar example but none where they are added together so I was looking for a pointer on what I might be missing. This is what I have so far:
False via contraposition: a^2 + b^2 is not divisible by 8 iff a or b are not even

Assume both a and b are odd
A = 2k + 1 and b = 2n + 1 where k and n are both integers

a^2 + b^2 = (2k + 1)^2 + (2n + 1)^2

a^2 + b^2 = 4k^2 + 4k + 1 + 4n^2 + 4n + 1

a^2 + b^2 = 4(k^2 + k + n^2 + n) + 2 (not divisble by 8 so doesnt help the case)

Assume a is odd

A = 2k + 1 and b = 2n

x^2 = 4k(k + 1) + 1
k(k + 1) is even (product of 2 numbers)

x^2 is of form 8k + 1

a^2 + b^2 = 8x + 1 + 8y + 1

a^2 + b^2 = 8(x – y) + 2 (the extra 2 is stoping this case from being true as well)

Best Answer

You want to disprove the statement

$$8\mid x^2+y^2\iff 2\mid x, y $$

As @J.W. Tanner pointed out in the comments, a simple counterexample - such as $2^2+4^2$ or its generalization $(2n)^2+(2n+2)^2=8n^2+8n+4\not\equiv 0\pmod 8$ - is enough. This proves that $$2\mid x, y\color{red}{\not\Rightarrow}8\mid x^2+y^2$$

However, you won't be able to disprove the other direction, since it is true $$8\mid x^2+y^2\color{red}{\implies}2\mid x,y$$ This follows from the fact that the only quadratic residues modulo $8$ are $\{0, 1, 4\}$.