f[x_]=Piecewise[{{-1,-Pi≤x<0},{0,x==0},{1,0<x≤Pi}}];

Plot[f[x],{x,-Pi,Pi}]

FourierCosCoefficient[f[x],x,n] (* Zero, since f[x] is odd. *)
FourierSinCoefficient[f[x],x,n]

Manipulate[
Plot[{f[x],Evaluate[FourierSeries[f[x],x,n]]},{x,-Pi,Pi}],
{{n,18,"Iteration Limit"},2,32,2,Appearance->"Labeled"}
(* TODO: Add series caching with DynamicModule. *)
]