f[x_]:=Which[-2Pi≤x<-Pi,1,-Pi≤x<0,-1,0≤x<Pi,1,Pi≤x<2Pi,-1]
p=Plot[f[x],{x,-2Pi,2Pi},PlotRange->{-2,2},PlotStyle->{Thickness[0.01],RGBColor[1,0,0]}]

a0=(1/(2*Pi))*(∫_(-Pi)^Pi)f[x]\[DifferentialD]x//FullSimplify
c1=(1/Pi)*(∫_(-Pi)^Pi)f[x]*Cos[n*x]\[DifferentialD]x//TrigReduce
c2=(1/Pi)*(∫_(-Pi)^Pi)f[x]*Sin[n*x]\[DifferentialD]x//TrigReduce

-((2 (-1+Cos[n π]))/(n π))

a=-((2 (-1+Cos[n π]))/(n π))
b=(a^2)

Pi*(∑_(n=1)^1)((4 (((-1+Cos[n π]))^2))/((n^2) (π^2)))
Pi*(∑_(n=1)^2)((4 (((-1+Cos[n π]))^2))/((n^2) (π^2)))
Pi*(∑_(n=1)^3)((4 (((-1+Cos[n π]))^2))/((n^2) (π^2)))
Pi*(∑_(n=1)^4)((4 (((-1+Cos[n π]))^2))/((n^2) (π^2)))
Pi*(∑_(n=1)^5)((4 (((-1+Cos[n π]))^2))/((n^2) (π^2)))
Pi*(∑_(n=1)^6)((4 (((-1+Cos[n π]))^2))/((n^2) (π^2)))
Pi*(∑_(n=1)^7)((4 (((-1+Cos[n π]))^2))/((n^2) (π^2)))
Pi*(∑_(n=1)^8)((4 (((-1+Cos[n π]))^2))/((n^2) (π^2)))
Pi*(∑_(n=1)^9)((4 (((-1+Cos[n π]))^2))/((n^2) (π^2)))
Pi*(∑_(n=1)^10)((4 (((-1+Cos[n π]))^2))/((n^2) (π^2)))

ListPlot[Table[Pi*(∑_(n=1)^N)((4 (((-1+Cos[n π]))^2))/((n^2) (π^2))),{N,1,100}],PlotStyle->PointSize[0.02]]
ListPlot[Table[Pi*(∑_(n=1)^N)((4 (((-1+Cos[n π]))^2))/((n^2) (π^2))),{N,1,100}],PlotJoined->True]

Cn=(1/2)(-i*-((2 (-1+Cos[n π]))/(n π)))

Q=(1/2)(i*-((2 (-1+Cos[n π]))/(n π)))

2*Pi(∑_(n=-∞)^∞)Cn*Q