It is easy to see that n>1.
When n=2k, k∈N, let x2i−1=1, x2i=−1, i=1,2,…,k, and y=1, then the condition is satisfied.
When n=2k+3, k∈N, let y=2, x1=4, x2=x3=x4=x5=−1, x2i=2, x2i+1=−2, i=3,4,⋯,k+1, then the condition is satisfied.
Now if n=3, and there exist x1,x2,x3,y such that
{x1+x2+x3=0,x12+x22+x32=3y2.
then
2(x12+x22+x3x2)=3y2.
Suppose gcd(x1,x2)=1, so x1,x2 are odd numbers or one is even while the other is odd. Hence x12+x22+x3x2 is an odd number. But 2∣3y2, so 3y2≡0(mod4). This is a contradiction since 2(x12+x22+x3x2)≡2(mod4).
The answer is n=1,3.