[Math] Prove if $n^2$ is even, then $n^2$ is divisible by 4

discrete mathematicselementary-number-theoryproof-writing

I am working on this question

Prove for every integer n if $n^2$ is even, then $n^2$ is divisible by 4.

prove by contradiction

Proof:

Since there exists an integer $n$ such that $n^2$ is even, and $n^2$ is not divisible by 4,

when $n$ is odd integer, we have $n = 2k + 1$ where $k \in \mathbb{Z}$,

then $n^2 = 4k^2 + 4k + 1$, because $n^2$ is odd which is a contradiction;

when $n$ is even integer, we have $n = 2j$ where $j \in\mathbb{Z}$,

then $n^2 = 4j^2 \Rightarrow n^2 | 4$, because $n^2$ is divisible by $4$, this is a contradiction; therefore, for every integer $n$, if $n^2$ is even, then $n^2$ is divisible by $4$.

Is my proof valid or can anyone give me hint or suggestion to write a better proof?

Thanks!

Best Answer

$$n^2\text{ even }\implies \text{n is even, hence:}$$$$n=2m,m\in\Bbb Z, n^2=4m^2\implies 4|n^2$$