You are right István Sikari-Nágl, it is not as easy at all as it looks.
f[x_] = Piecewise[{{x + π, -π < x < 0}, {x - π, 0 < x < π}}]; g = FourierSeries[f[x], x, 2] // ExpToTrig (* -2 Sin[x] - Sin[2 x] *) Edit
Now I build the periodic function.
Column[{ Plot[ Plot[f[Mod[x,-2 Pi]], {gx,-3 f[Mod[xPi, 3 Pi}, Exclusions -> None, ImageSize -> 250], Plot[f[Mod[x, 2 π]]Pi]], {x,-3 Pi, 3 Pi}, Exclusions -> None, ImageSize -> 250], Plot[f[Mod[x,-2 Pi]] + f[Mod[x, 2 π]]}Pi]], {x,-3 Pi, 3 Pi},Exclusions -> None, ImageSize -> 250], Plot[{g, f[Mod[x, 2 Pi,-Pi]]}, {x,-3 πPi, 3 πPi}, Exclusions -> None]None, ImageSize -> 250] }] 
