Use Fourier series of odd function to evaluate $1-\frac15+\frac17-\frac1{11}+\cdots$

You need to make an even $2\pi$-periodic extension of the function $f$, that is, define $\tilde{f}$ such that

$$ \tilde{f}(-x) = \tilde{f}(x) $$

and

$$ \tilde{f}(x) = f(x) ~~~\mbox{for}~~ 0 < x < \pi $$

Since $\tilde{f}$ is periodic, the only Fourier coefficients that are not trivially zero are

$$ a_n = \frac{1}{2\pi}\int_{-\pi}^{\pi}{\rm d}x~\tilde{f}(x)\cos n x $$

After evaluating the integral you get $a_0 = 0$ and

$$ a_{n} = \frac{2}{3n}\left[\sin \frac{n\pi}{3} + \sin\frac{2n\pi}{3} -\sin n\pi \right] ~~~ n \ge 1 $$

Here's a reconstruction of the function with the 60 lowest modes $n \le 60$

$$ \tilde{f}(x) = \sum_{n\ge 1} a_n \cos nx $$

enter image description here

With this you can solve the second problem

$$ f(0) = \frac{\pi}{3} = \sum_{n\ge 1} a_n = \frac{2}{\sqrt{3}}\left[ 1 - \frac{1}{5} + \frac{1}{7} \cdots \right] $$

or equivalently

$$ \frac{\pi}{2\sqrt{3}} = 1 -\frac{1}{5} + \frac{1}{7} \cdots $$