$\textbf{Question :}$ Prove that $$\sum_{j=1}^{n} (-1)^{j-1}\cos\left(\frac{j\pi}{2n+1}\right)=\frac{1}{2}$$
$\textbf{My Attempt :}$
Let $n$ be odd (will do even case later) then the series can be written as
$$S = \sum_{j=1}^{(n+1)/2}\cos((2j-1)x) - \sum_{j=1}^{(n-1)/2} \cos(2jx)$$
where $x = \frac{\pi}{2n+1}$
Now as both the cosine series are just arithmetic progressions in their angles with the common difference of $2x$, we can simplify $S$ as follows :
$$S = \frac{1}{\sin x}(\sin((n+3)x)\cos((n+2)x)-\sin((n+1)x)\cos(nx))$$
As $2\sin a\cos b = \sin(a+b)+\sin(a-b)$
$$S = \frac{1}{2\sin x}(\sin(2n+5)x)-\sin((2n+1)x)$$
Again as $\sin c -\sin d = 2\sin((c+d)/2)\cos((c-d)/2)$
$$S = \frac{1}{2 \sin x} (2\sin 2x \cos((2n+3)x))$$
$$S = \cos x \cos ((2n+3)x)$$ Now this is where I am getting stuck, I can't get it equal to any constant...
We have \begin{align*} &\cos \frac{x}{2} \cdot \sum_{j=1}^{n} (-1)^{j-1}\cos(j x)\\ ={}& \sum_{j=1}^n (-1)^{j-1} \frac12[\cos(j x - x/2) + \cos(jx + x/2)]\\ ={}& \sum_{j=1}^n (-1)^{j-1} \frac12\cos(j x - x/2) + \sum_{j=1}^n (-1)^{j-1} \frac12\cos(jx + x/2)\\ ={}&\frac12 \cos \frac{x}{2} + \sum_{j=2}^n (-1)^{j-1} \frac12\cos(j x - x/2) + \sum_{j=1}^{n-1} (-1)^{j-1} \frac12\cos(jx + x/2) \\ &\qquad + (-1)^{n-1}\frac12\cos(nx + x/2)\\ ={}&\frac12 \cos \frac{x}{2} - \sum_{j=1}^{n-1} (-1)^{j-1} \frac12\cos(j x + x/2) + \sum_{j=1}^{n-1} (-1)^{j-1} \frac12\cos(jx + x/2)\\ &\qquad + (-1)^{n-1}\frac12\cos(nx + x/2)\\ ={}& \frac12 \cos \frac{x}{2} + (-1)^{n-1}\frac12\cos(nx + x/2) \end{align*} which results in (when $\cos (x/2) \ne 0$) $$\sum_{j=1}^{n} (-1)^{j-1}\cos(j x) = \frac12 + \frac{(-1)^{n-1}\cos(nx + x/2)}{2\cos (x/2)}.$$
Letting $x = \frac{\pi}{2n + 1}$, the desired result follows.