Please notice that in Fourier coefficient, you just need to calculate integration in one period, it's not necessary to be symmetric around origin. i.e.
\begin{align}
a_0 &=\frac{1}{L}\int_{<T>}f(x)dx \\
a_n &=\frac{1}{L}\int_{<T>}f(x) \cos\left ( \frac{n\pi x}{L} \right )dx \\
b_{n} &=\frac{1}{L}\int_{<T>}f(x) \sin\left ( \frac{n\pi x}{L} \right )dx
\end{align}
here $T = 2-1=1$ and $L = \frac{T}{2}=\frac{1}{2}$. The function is depicted in the figure below

Therefore the coefficients are ($\cos (n\pi) = (-1)^n$)
\begin{align}
a_0 &=\frac{1}{\frac{1}{2}}\int_{1}^{2}xdx =3 \\
a_{n} &=\frac{1}{\frac{1}{2}}\int_{1}^{2} x\cos\left ( n\pi x\right )dx = \frac{x\sin(n\pi x)}{(n\pi)}+\frac{\cos(n\pi x)}{(n\pi)^2} \Bigl|_{1}^{2}=\frac{2(1-(-1)^n)}{(n\pi)^2}\\
b_{n} &=\frac{1}{\frac{1}{2}}\int_{1}^{2}x \sin\left ( n\pi x\right )dx = \frac{-x\cos(n\pi x)}{(n\pi)}+\frac{\sin(n\pi x )}{(n\pi)^2} \Bigl|_{1}^{2}=\frac{-2(2-(-1)^n)}{n\pi}
\end{align}
If you want to find the coefficients in another interval, you can simply find the equation of the function in that interval and calculate the integrals. Here is an exercise. Show that the below integrals yields the same results
\begin{align}
a_0 &=\frac{1}{\frac{1}{2}}\int_{0}^{1}(x+1)dx \\
a_{n} &=\frac{1}{\frac{1}{2}}\int_{0}^{1} (x+1)\cos\left ( n\pi x\right )dx \\
b_{n} &=\frac{1}{\frac{1}{2}}\int_{0}^{1} (x+1)\sin\left ( n\pi x\right )dx
\end{align}
Since
$$f(x) = \begin{cases}\vdots & \\
x+2 &-1\le x< 0 \\
x+1 &0\le x< 1 \\
x &1\le x< 2 \\
x-1 &2\le x< 3 \\
\vdots &
\end{cases}$$