I do not understand your approach.
You have asked if what you have done is correct. This suggests to me that you don't know how to check or that you do not understand the subject.
I am suggesting you sketch a graph of how x and x^2 varies with n and use the symmetry of that graph, along with your understanding of what "expectation value"
means, to check to see if your answers are plausible. If the symmetry is easy (it is) then it is easy to tell if you are right or not.
i.e. you have got E[x]=0 - so sketch x vs n and see if x=0 is a plausible average value.
But if you don't understand "expectation value" then that won't make much sense to you: this is part of what I'm trying to find out.
i.e. There is a complication in the formula if N is a small number.
say if ##N=2##
then ##x_1=2\cos(\pi)=0, x_2=2\cos(2\pi)=2\implies E[x]=(x_1+x_2)/2=(0+2)/2=1## ...
It can also make a difference where you start your sum from.
If you start from ##n=1##, then the expectation works out as above, but if you start from ##n=0##:
##E[x]=(x_0+x_1+x_2)/3 = (2+0+2)/3=4/3##
... notice: in both cases: ##(E[x])^2\neq 0##
... I have adjusted my original reply to reflect this BTW.
So: is N a small number or a large number? (see the definition of the expectation value)
Details matter - what is the original problem statement?