You have an equation that has to maximized with a second condition that has to be fulfilled. This calls for a Lagrange multiplier.
We look for the maximum of $\sum_i x_i^2$ with $\sum_i x_i = 0$. First we can define:
$$\Lambda = \sum_{i=1}^{2m+1} x_i^2 + \lambda\sum_{i=1}^{2m+1} x_i$$
Note that adding the second summand is effectively adding zero. Now we look for a maximum of all variables:
$$\vec{0}=\left(\frac{\partial \Lambda}{\partial x_1}, \frac{\partial \Lambda}{\partial x_2}, ..., \frac{\partial \Lambda}{\partial x_{2m+1}}, \frac{\partial \Lambda}{\partial \lambda}\right)\\
=\left(2x_1+\lambda, 2x_2+\lambda, ..., 2x_{2m+1}+\lambda, 0\right)$$
where it was used again that $\sum_i x_i=0$.
The only solution to this is that all $x_i$ are equal, which immediately implies that all $x_i=0$ because their sum must be $0$. So the only extremum we found is a minimum, which means that the maximum lies at the boundary of the allowed region, which means that at least one $x_i$ must be equal to $1$ or $-1$.
Since the problem is symmetric in $i$, we can assume that $x_1=1$. (The argument for $x_1=-1$ is analoguous.) This leads to the reduced formula:
$$\Lambda_1 = 1+\sum_{i=2}^{2m+1} x_i^2 + \lambda\left(1+\sum_{i=2}^{2m+1}x_i\right)$$
Note that the last term again is zero and thus can be added freely.
We look for the extremums and get:
$$\vec{0}=\left(\frac{\partial \Lambda_1}{\partial x_2}, ..., \frac{\partial \Lambda_1}{\partial x_{2m+1}}, \frac{\partial \Lambda_1}{\partial \lambda}\right)\\
=\left(2x_2+\lambda, ..., 2x_{2m+1}+\lambda, 0\right)$$
This has only one solution: $$x_i=-\frac{\lambda}{2}, i\ge 2$$
Obviously, this is again a minimum, as can be seen by taking the second derivative, which is $2>0$ in every component.
Now, the same argument as before applies: The maximum must lie on the boundary. We can repeat this step, finding that all variables except $x_{2m+1}$ must be $-1$ or $1$. Combinations that would make $\sum_i x_i=0$ impossible can be ignored.
Finally, we arrive at the last step:
$$\Lambda_{2m} = 2m+x_{2m+1}^2 + \lambda\left(x_{2m+1}-c\right)$$
where c is the sum of all other variables except $x_{2m+1}$. But since this is an even number of variables all being either $1$ or $-1$, the sum must be an even number. The only allowed even number that makes it possible for the sum to be zero by adding $x_{2m+1}$ is zero, and from this we know the only value possible for $x_{2m+1}$ is zero as well.
So we have got the maximum value for the sum of the squares:
$$\sum_{i=1}^{2m+1}x_i^2 \le m\cdot|\pm1|^2+0 = 2m$$