Hint $\ $ Induction yields a direct proof: $\rm\ 2\ |\ n^2\:\Rightarrow\:2\ |\ n\:$ is true for $\rm\:n = 0,1\:$ so $\rm\color{red}{induction}$ yields
$$\rm 2\ |\ (n+1)^2 = (n-1)^2 + 4n\ \Rightarrow\ 2\ |\ (n-1)^2\ \color{red}{\Rightarrow}\ 2\ |\ n-1\ \Rightarrow\ 2\ |\ n+1$$
Similarly one may prove $\rm\: 2\ |\ nk\:\Rightarrow\: 2\ |\ n\ \ or\ \ 2\ |\ k\ $ (Prime Divisor Property for $\rm\:p = 2$) via
$$\rm\ 2\ |\ (n+1)k = (n-1)k + 2k\ \Rightarrow\ 2\ |\ (n-1)k\ \color{red}{\Rightarrow}\ 2\ |\ n-1\ \ or\ \ 2\ |\ k\ \Rightarrow\ 2\ |\ n+1\ \ or\ \ 2\ |\ k$$
Note that your problem is the special case $\rm\ k = n\ $ of the Prime Divisor Property for $\:2$.
Note that the proof is essentially a brute-force case-analysis. It verifies the result for a complete system of least residues modulo $2,\:$ viz. $\rm\:0,1,\:$ and then, by induction, lifts this proof to all naturals, using the fact that the property $\rm\:P\:$ is true for $\rm\:n\:$ implies that it is true for $\rm\:n+2,\:$ i.e.
$$\rm P(0),\ P(1),\ [P(n)\Rightarrow P(n+2)]\ \Rightarrow\ \ \forall n\: P(n)$$
Similarly there are brute-force residue case-analyis proofs of the prime divisor property for any fixed prime (as known to the ancient Greeks). Such proofs amount to brute-force checking all entries of the multiplication table for integers modulo p, to verify that a product is zero implies that some factor is zero. But proving this true for all primes requires a new idea. For the integers this idea is that gcds exist for all naturals (by the Euclidean algorithm), hence
$$\rm\:p\ |\ ab\ \Rightarrow\ p\ |\ pb,ab\ \Rightarrow\ p\ |\ gcd(pb,ab) = \gcd(p,a)b\:$$
$\rm p\:$ prime $\Rightarrow$ $\rm gcd(p,a) = p\ or\ 1$. $\rm\:gcd(p,a)=p\:$ $\Rightarrow$ $\rm\:p\:|\:a.\:$ $\rm\:gcd(p,a)=1\:$ $\Rightarrow$ $\rm\:p\:|\:gcd(p,a)b = b.$
Hence we've proved: $\:$ prime $\rm p\ |\ ab\ \Rightarrow\ p\ |\ a\ \ or\ \ p\ |\ b\quad\ \ $ [Prime Divisor Property for $\mathbb Z\:$]
This prime divisor property is easily shown to be equivalent to the uniqueness of factorizations into irreducibles. In domains that don't have unique factorization, irreducibles need not satisfy the prime divisor property. In such general domains, the term "prime" is used to denote those irreducibles that do satisfy the prime divisor property
The same proof as above shows that irreducibles satisfy the prime divisor property in any integral domain where gcds exist, e.g. Euclidean domains which, like $\mathbb Z$, enjoy a Division Algorithm. One well-known example is the ring $\rm F[x]$ of polynomials over a field $\rm F,\:$ which enjoy the high-school polynomial long division algorithm.
Best Answer
To prove a statement $p \rightarrow q$, we can instead prove its contrapositive $\lnot q \rightarrow \lnot p$, because the two forms of implication are equivalent: an implication is true if and only if its contrapositive is true: $$p\rightarrow q \equiv \lnot q \rightarrow \lnot p.$$
Let $p$ denote "$4$ divides $x^2$."
Let $q$ denote "$x$ is even."
We want to prove $p\rightarrow q$ by proving $\lnot q \rightarrow \lnot p$.
Proof:
Suppose $x$ is not even (that is, suppose $x$ is odd). Then $x = 2k+1$ for some integer $k$.
And if $x= 2k+1$, it follows that $$x^2 = (2k+1)^2 = 4k^2 + 4k + 1 = 4(k^2 + k) + 1$$
Clearly, $4$ does not divide $x^2 = 4(k^2+k) +1$, because $4$ does not divide $1$.
Having proved "$x$ not even" $\implies$ "$x^2$ is not divisible by $4$," we have proved its equivalent:
as desired.