I want to find the Fourier series of the function. For now, I am clueless on how to handle the function, int that it has $f(x+2)=f(x).$ $$f(x)=\begin{cases}x+1 & -1\leq x< 0,\\1-x &0\leq x< 1\end{cases},\;\;f(x+2)=f(x)$$ Question:
Can anyone explain what this term ($f(x+2)=f(x)$) means in relation to the function? Solution or references will be highly appreciated.
BACKGROUND
First $f(x+2) = f(x)$ is just a way of saying that you got to repeat your function, i.e. it is periodic of period $2$.
This is needed so that we could derive the fourier series, \begin{equation} a_0 + \sum\limits_{k=1}^{\infty} a_k\cos(k x) + b_k \sin(k x) \end{equation} where \begin{align} a_0 &= \frac{1}{T} \int\limits_{-\frac{T}{2} }^{\frac{T}{2} } f(x) \ dx \\ a_k &= \frac{2}{T} \int\limits_{-\frac{T}{2} }^{\frac{T}{2}} f(x) \cos(kx) \ dx \\ b_k &= \frac{2}{T} \int\limits_{-\frac{T}{2} }^{\frac{T}{2} } f(x) \sin(kx) \ dx \\ \end{align} with $T$ being the period of our function, which in our case is $2$, right?
COMPUTING $a_0$
Let's compute $a_0$ \begin{equation} a_0 = \frac{1}{T} \int\limits_{-\frac{T}{2} }^{\frac{T}{2} } f(x) \ dx = \frac{1}{2} \int\limits_{-1 }^{1 } f(x) \ dx = \frac{1}{2} \int\limits_{-1 }^{0} (x+1) \ dx +\frac{1}{2} \int\limits_{1}^{0} (1-x) \ dx = \frac{1}{4} + \frac{1}{4} = \frac{1}{2} \end{equation}
COMPUTING $a_k$
Now, to compute $a_k$, we use the formula \begin{equation} a_k = \frac{2}{2} \int\limits_{-1 }^{1} f(x) \cos(kx) \ dx = \int\limits_{-1 }^{0} (x+1) \cos (kx) \ dx + \int\limits_{0 }^{1} (1-x) \cos (kx) \ dx \end{equation} that is after starightforward math \begin{equation} a_k = \frac{2}{2} \int\limits_{-1 }^{1} f(x) \cos(kx) \ dx = -2\dfrac{\cos\left(k\right)-1}{k^2} \end{equation}
COMPUTING $b_k$
Now, to compute $b_k$, we use the formula \begin{equation} b_k = \frac{2}{2} \int\limits_{-1 }^{1} f(x) \sin(kx) \ dx = \int\limits_{-1 }^{0} (x+1) \sin (kx) \ dx + \int\limits_{0 }^{1} (1-x) \sin (kx) \ dx \end{equation} that is after staright-forward math \begin{equation} b_k = \dfrac{\sin\left(k\right)-k}{k^2} -\dfrac{\sin\left(k\right)-k}{k^2} = 0 \end{equation}
NOTE on $b_k$
Since $f(x) = f(-x)$ (easy to prove), then $f(x)$ is even, then $b_k = 0$ for all $k$. That's a property btw.