You have $f(x) = \begin{cases} -2x-x^2, & -2 \leq x <0 \\ 2x-x^2, & 0 \leq x < 2 \end{cases}$. Note that $f(-x) = f(x)$, a fact that will simplify our computations.
The formulae for the Fourier coefficients are:
$$a_0 = \frac 1 2 \int \limits _{-2} ^2 f(x) \textrm d x = \int \limits _0 ^2 f(x) \textrm d x = \frac 4 3 \\
a_n = \frac 1 2 \int \limits _{-2} ^2 f(x) \cos \frac {n \pi x} 2 \textrm d x = \int \limits _0 ^2 f(x) \cos \frac {n \pi x} 2 \textrm d x = -8 \frac {1 + (-1)^n} {n^2 \pi^2} \\
b_n = \frac 1 2 \int \limits _{-2} ^2 f(x) \sin \frac {n \pi x} 2 \textrm d x = 0 .$$
(The last integral is $0$ because it is the integral of an odd integrand over a symmetric interval, no need to compute anything. The value of $a_n$ has been obtained by integrating by parts twice and the interval has been halved because the integrand is even and the interval symmetric.)
Therefore, you may write that (remembering that the first term is $\frac {a_0} 2$)
$$f(x) = \frac 2 3 + \sum \limits _{n=1} ^\infty -8 \frac {1 + (-1)^n} {n^2 \pi^2} \cos \frac {n \pi x} 2 .$$
Since $-8 \frac {1 + (-1)^n} {n^2 \pi^2}$ is $0$ for odd $n$, and $- \frac {16 } {n^2 \pi^2}$ when $n=2k$, the previous formula becomes
$$f(x) = \frac 2 3 - \frac {16} {\pi^2} \sum \limits _{k=1} ^\infty \frac {\cos (k \pi x)} {(2k)^2} = \frac 2 3 - \frac 4 {\pi^2} \sum \limits _{k=1} ^\infty \frac {\cos (k \pi x)} {k^2} .$$
Take now $x=0$ making all the numerators inside the series equal to $1$. Then
$$0 = \frac 2 3 - \frac 4 {\pi^2} \sum \limits _{k=1} ^\infty \frac 1 {k^2}$$
which can be rearranged as
$$\frac {\pi^2} 6 = \sum \limits _{k=1} ^\infty \frac 1 {k^2}$$
(notice that it is $\frac {\pi^2} 6$, not $\frac {\pi^2} {12}$ as you wrote in your question).