As pointed out by Andrei above we may assume $x>0$ so that our function $f(x)=x(\pi-|x|)$ reduces to $f(x)=x\pi-x^2$. Now differentiate w.r.t. $x,$ which yields
\begin{align*}
\frac{\mathrm d}{\mathrm dx}[x\pi-x^2]&=\frac{\mathrm d}{\mathrm dx}\left[\frac4\pi\sum_{n=1}^{\infty}\frac{(-1)^{n+1}+1}{n^3}\sin(nx)\right]\\
\pi-2x&=\frac4\pi\sum_{n=1}^{\infty}\frac{(-1)^{n+1}+1}{n^2}\cos(nx)
\end{align*}
Now choose $x=\pi$ to obtain
\begin{align*}
\pi-2\pi&=\frac4\pi\sum_{n=1}^{\infty}\frac{(-1)^{n+1}+1}{n^2}\cos(n\pi)\\
-\pi&=\frac4\pi\sum_{n=1}^{\infty}\frac{(-1)^{n+1}+1}{n^2}(-1)^n\\
-\pi&=\frac4\pi\sum_{n=1}^{\infty}\left[\frac{(-1)^n}{n^2}-\frac1{n^2}\right]\\
\pi&=\frac4\pi\sum_{n=1}^{\infty}\left[\frac{(-1)^{n+1}}{n^2}+\frac1{n^2}\right]
\end{align*}
Note that the RHS is the sum of the two sums you are asked to find. However, they are related in another way. Therefore observe the following:
$$\sum_{n=1}^\infty \frac{(-1)^{n+1}}{n^2}=\sum_{n=1}^\infty\frac1{n^2}-2\sum_{n=1}^\infty\frac1{(2n)^2}=\frac12\sum_{n=1}^\infty\frac1{n^2}.$$
Using this relation we can rewrite the latter sum from above as
$$\sum_{n=1}^{\infty}\left[\frac{(-1)^{n+1}}{n^2}+\frac1{n^2}\right]=\sum_{n=1}^{\infty}\frac{(-1)^{n+1}}{n^2}+\sum_{n=1}^{\infty}\frac1{n^2}=\frac12\sum_{n=1}^{\infty}\frac1{n^2}+\sum_{n=1}^{\infty}\frac1{n^2}=\frac32\sum_{n=1}^{\infty}\frac1{n^2},$$
which completes to
$$\pi=\frac4\pi\left[\frac32\sum_{n=1}^{\infty}\frac1{n^2}\right]\implies \sum_{n=1}^{\infty}\frac1{n^2}=\frac{\pi^2}6.$$
Congratulations, you just resolved the famous Basel Problem. However, by using the deduced relation between the two sums we can fairly easy conclude the value of the second one.
$$\therefore~\sum_{n=1}^{\infty}\frac1{n^2}~=~\frac{\pi^2}6\text{ and }\sum_{n=1}^\infty \frac{(-1)^{n+1}}{n^2}~=~\frac{\pi^2}{12}$$
This time we dealt with the Riemann Zeta Function $\zeta(s)$ and the Dirichlet Eta Function $\eta(s)$, showed that $\eta(2)=\frac12\zeta(2)$ as well as $\zeta(2)=\pi^2/6$ and $\eta(2)=\pi^2/12$.
First of all we may write out both sums
\begin{align*}
\sum_{n=1}^\infty \frac1{n^2}&=1+\frac1{2^2}+\frac1{3^2}+\frac1{4^2}+\cdots\\
\sum_{n=1}^\infty \frac{(-1)^{n+1}}{n^2}&=1-\frac1{2^2}+\frac1{3^2}-\frac1{4^2}+\cdots
\end{align*}
So we obtain the latter sum from the first one by subtracting all even terms not once but twice $($keep the case where we only substract them once in mind, I will come back to this in a minute$)$. However, the even terms are given by $1/(2n)^2$. Therefore we can also write this relation as
$$\sum_{n=1}^\infty \frac{(-1)^{n+1}}{n^2}=\sum_{n=1}^\infty \frac1{n^2}-\color{red}2\sum_{n=1}^\infty \frac1{(2n)^2}$$
What is left now are simple algebraic manipulations. Hence we get that
$$\sum_{n=1}^\infty \frac{(-1)^{n+1}}{n^2}=\sum_{n=1}^\infty \frac1{n^2}-2\sum_{n=1}^\infty \frac1{2^2n^2}=\sum_{n=1}^\infty \frac1{n^2}-\frac24\sum_{n=1}^\infty \frac1{n^2}=\sum_{n=1}^\infty \frac1{n^2}-\frac12\sum_{n=1}^\infty \frac1{n^2}$$
And so we can finally conclude that
$$\sum_{n=1}^\infty \frac{(-1)^{n+1}}{n^2}=\frac12\sum_{n=1}^\infty \frac1{n^2}$$
Now lets take a look at the odd terms alone
\begin{align*}
\sum_{n=1}^\infty \frac1{n^2}&=1+\frac1{2^2}+\frac1{3^2}+\frac1{4^2}+\cdots\\
\sum_{n=0}^\infty \frac1{(2n+1)^2}&=1+0+\frac1{3^2}+0+\cdots
\end{align*}
Note that is what we get by only substracting the even terms once. This can be written as
$$\sum_{n=0}^\infty \frac1{(2n+1)^2}=\sum_{n=1}^\infty\frac1{n^2}-\color{red}1\sum_{n=1}^\infty \frac1{(2n)^2}$$
Again this can be further simplied which eventually gives us
$$\sum_{n=0}^\infty \frac1{(2n+1)^2}=\sum_{n=1}^\infty \frac1{n^2}-1\sum_{n=1}^\infty \frac1{2^2n^2}=\sum_{n=1}^\infty \frac1{n^2}-\frac14\sum_{n=1}^\infty \frac1{n^2}$$
Thus
$$\sum_{n=0}^\infty \frac1{(2n+1)^2}=\frac34\sum_{n=1}^\infty \frac1{n^2}$$
The latter sums is known as Dirichlet Lambda Function $\lambda(s)$ and we just showed the relation $\lambda(2)=\frac34\zeta(2)$. However, the second example is only here to illustrate how one can argue in order to produce such relation betweens different series.
Moreover note that the results from above can generalised as
\begin{align*}
\eta(s)&=(1-2^{1-s})\zeta(s)\\
\lambda(s)&=(1-2^{-s})\zeta(s)
\end{align*}
I would recommend to you to actually prove these relations by using the series representations to get used to these kinds of manipulations. Additionally the Riemann Zeta Function, and its relatives, are yet alone worth being studied. Hopefully now everthing is clear; if not: feel free to ask.