Here's the idea: remember that you have to compute a bunch of integrals of the form $\int_{-\pi}^{\pi}f(t)\sin\;jt\;\mathrm dt$ $\int_{-\pi}^{\pi}f(t)\cos\;jt\;\mathrm dt$. Remember also that if a function $g(x)$ is odd, then $\int_{-c}^c g(t)\mathrm dt$ is zero (why?). Now, what happens if you try to expand an odd function?
As for your putative identity... the fact that there's no $c$ in the right hand side of your equation should make you doubtful that you wrote that one down correctly. Fourier series proper involve sines and cosines (or complex exponentials), not integer powers.
$f(x) = |\sin(x)| \quad \Rightarrow\quad f(x) = \left\{
\begin{array}{l l}
-\sin(x) & \quad \forall x \in [- \pi, 0\space]\\
\sin(x) & \quad \forall x \in [\space 0,\pi\space ]\\
\end{array} \right.$
The Fourier coefficients associated are
$$a_n= \frac{1}{\pi}\int_{-\pi}^\pi f(x) \cos(nx)\, dx = \frac{1}{\pi} \left[\int_{-\pi}^0 -\sin (x) \cos(nx)\, dx + \int_{0}^\pi \sin(x) \cos(nx)\, dx\right], \quad n \ge 0$$
$$b_n= \frac{1}{\pi}\int_{-\pi}^\pi f(x) \sin(nx)\, dx = \frac{1}{\pi} \left[\int_{-\pi}^0 -\sin (x) \sin(nx)\, dx + \int_{0}^\pi \sin(x) \sin(nx)\, dx\right], \quad n \ge 1$$
All functions are integrable so we can go on and compute the expressions for $a_n$ and $b_n$.
$$a_n = \cfrac{2 (\cos(\pi n)+1)}{\pi(1-n^2)}$$
$$b_n = 0$$
The $b_n = 0$ can be deemed obvious since the function $f(x) = |\sin(x)|$ is an even function. and $a_n$ could have been calculated as $\displaystyle a_n= \frac{2}{\pi}\int_{0}^\pi f(x) \cos(nx)\, dx $ only because the function is even.
The Fourier Series is $$\cfrac {a_0}{2} + \sum^{\infty}_{n=1}\left [ a_n \cos(nx) + b_n \sin (nx) \right ]$$
$$= \cfrac {2}{\pi}\left ( 1 + \sum^{\infty}_{n=1} \cfrac{(\cos(\pi n)+1)}{(1-n^2)}\cos(nx)\right )$$
$$= \cfrac {2}{\pi}\left ( 1 + \sum^{\infty}_{n=1} \cfrac{((-1)^n+1)}{(1-n^2)}\cos(nx)\right )$$
$$= \cfrac {2}{\pi}\left ( 1 + \sum^{\infty}_{n=1} \cfrac{2}{(1-4n^2)}\cos(2nx)\right )$$
Since for an odd $n$, $((-1)^n+1) = 0$ and for an even $n$, $((-1)^n+1) = 2$
At this point we can't just assume the function is equal to its Fourier Series, it has to satisfy certain conditions. See Convergence of Fourier series.
Without wasting time, (you still have to prove that it satisfies those conditions) we assume the Fourier Series converges to our function i.e
$$f(x) = |\sin(x)| = \cfrac {2}{\pi}\left ( 1 + \sum^{\infty}_{n=1} \cfrac{2}{(1-4n^2)}\cos(2nx)\right )$$
Note that $x=0$ gives $\cos(2nx) = 1$ then
$$f(0) = |\sin(0)| = \cfrac {2}{\pi}\left ( 1 + 2\sum^{\infty}_{n=1} \cfrac{1}{(1-4n^2)}\right ) =0$$ which implies that
$$\sum^{\infty}_{n=1} \cfrac{1}{(1-4n^2)} = \cfrac {-1}{2}$$ and $$\boxed {\displaystyle\sum^{\infty}_{n=1} \cfrac{1}{(4n^2 -1)}= -\sum^{\infty}_{n=1} \cfrac{1}{(1-4n^2)} = \cfrac {1}{2}}$$
Observe again that when $x = \cfrac \pi 2$, $\cos (2nx) = cos(n \pi) = (-1)^n$, thus
$$f \left (\cfrac \pi 2 \right) = \left |\sin \left (\cfrac \pi 2\right )\right | = \cfrac {2}{\pi}\left ( 1 + 2\sum^{\infty}_{n=1} \cfrac{(-1)^n}{(1-4n^2)}\right ) =1$$ which implies that
$$\sum^{\infty}_{n=1} \cfrac{(-1)^n}{(1-4n^2)} = \cfrac {1}{4}(\pi -2)$$ and $$\boxed {\displaystyle\sum^{\infty}_{n=1} \cfrac{(-1)^n}{(4n^2 -1)}= -\sum^{\infty}_{n=1} \cfrac{(-1)^n}{(1-4n^2)} = \cfrac {1}{4}(2-\pi)}$$
Best Answer
Whether you include the endpoints of the interval or not is immaterial. There are Fourier sine series and Fourier cosine series on any interval. The cosine series is the full Fourier series of the function extended to $[-l, l]$ by $f(-x) = f(x)$ and then made periodic. The sine series is the full Fourier series of the function extended to $[-l,l]$ by $f(-x) = -f(x)$ and then made periodic.
BTW: your cosine series should be $$ \frac{l}{2} - \frac{4l}{\pi^2} \sum_{n=1,3,5,\ldots} \frac{\cos\left(\frac{n\pi x}{l}\right)}{n^2} $$