Let's start from what we know.

Note that:

(sign of last term will be + when n is even and - when n is odd).
Sum is finite so we can split it into two sums, first

with only positive trems (squares of even numbers) and second

with negative (squares of odd numbers). So:

And now the proof.
1) n is even.
In this case, both

and

have

terms. For example if n=8 then:

Generally, there will be:

Now, calculate our sum:



So in this case we prove, that:

2) n is odd.
Here,

has more terms than

. For example if n=7 then:

So there is

terms in

,

terms in

and:

Now, we can calculate our sum:




We consider all possible n so we prove that: