You are using Latex coding, which doesn't work in Mathematica.
Here is the way to define your function in Mathematica:
f[x_]:=Which[-Pi<=x<0,-1/2 (Pi+x), 0<x<=Pi,1/2 (Pi-x)]
You can plot this to see your sawtooth function.
Plot[f[x], {x, -Pi, Pi}]
and you can find the Fourier transform
In[3]:= FourierTransform[f[x], x, k]
Out[3]= (E^(-I k \[Pi]) - E^(I k \[Pi]) + 2 I k \[Pi])/(2 k^2 Sqrt[
2 \[Pi]])
Or if you want the complex Fourier series up to n=3
In[6]:= FourierSeries[f[x], x, 3]
Out[6]= 1/2 I E^(-I x) - 1/2 I E^(I x) + 1/4 I E^(-2 I x) -
1/4 I E^(2 I x) + 1/6 I E^(-3 I x) - 1/6 I E^(3 I x)