I was reading this question, and made a wrong contribution which I deleted. Now I would like to understand things. Here is the problem:
Consider $f(x)=\cos 2x$ on $[0,\pi]$:

$f(x)$ is not even on $[0,\pi]$.
$$a_m=\frac{2}{\pi}\int_0^{\pi}\cos 2x \cos mx =\frac{2}{\pi}\frac{m \sin m \pi}{m^2-4}=0,m=0,1,3,4,5...$$
and $a_2=1$. But for $m$ odd we have
$$b_m=\frac{2}{\pi}\int_0^{\pi}\cos 2x \sin mx =\frac{4}{\pi}\frac{2m-1}{4m^2-4m-3}$$
and for $m$ even we have $b_m=0$. Now I define the following function: \begin{align} F(x)&=\frac{2}{\pi}\sum_{m=1}^{\infty}\frac{m (1-\cos m \pi)}{m^2-4}\sin [mx]\\ &=\frac{4}{\pi}\sum_{m=1}^{\infty}\frac{2m-1}{4m^2-4m-3}\sin [(2m-1)x] \end{align}
Now define $\displaystyle F_n(x)=\frac{4}{\pi}\sum_{m=1}^{n}\frac{2m-1}{4m^2-4m-3}\sin [(2m-1)x]$ and lets plot $F_1(x)$ against $f(x)$:

Now lets plot $F_{20}(x)$ against $f(x)$:

And this is what happens for $n=100$:

So can I say then say $F_n(x)$ converge to $\cos 2x$ on $(0,\pi)$ this sounds puzzling. Maybe I made a mistake. Could anyone please explain me what is going on here?
The series you got is the odd extension of this function to $[-\pi,\pi]$and periodic with period $2\pi$.
You are seeing in the partial sums the Gibbs phenomenon.
If you were to take the Cesaro sums of the series you would see it converge to $0$ at $x=0$ and similar points, see Fejer's theorem.