The Fourier series of a function \(f(x)\) on \([-\pi,\pi]\) is given by
\begin{equation*}
f(x) \sim \frac{a_0}{2} + \sum_{n=1}^{\infty} \left(a_n \cos(nx) + b_n \sin(nx)\right),
\end{equation*}
where the coefficients are computed as
\begin{equation*}
a_0 = \frac{1}{\pi}\int_{-\pi}^{\
pi} f(x)\,dx, \quad
a_n = \frac{1}{\pi}\int_{-\pi}^{\pi} f(x)\cos(nx)\,dx
\end{equation*}
\begin{equation*}
b_n = \frac{1}{\pi}\int_{-\pi}^{\pi} f(x)\sin(nx)\,dx.
\end{equation*}
Since \(f\) is an odd function on \([-\pi,\pi]\text{,}\) all cosine coefficients vanish. The Fourier series has the form
\begin{equation*}
f(x) \sim \sum_{n=1}^{\infty} b_n \sin(nx).
\end{equation*}
The sine coefficients are
\begin{equation*}
b_n = \frac{1}{\pi}\int_{-\pi}^{\pi} x\sin(nx)\,dx.
\end{equation*}
Compute the integral using odd/even symmetry or integration by parts. Because \(x\sin(nx)\) is even, we get
\begin{equation*}
b_n = \frac{2}{\pi}\int_{0}^{\pi} x\sin(nx)\,dx
= \frac{2}{\pi}\left[\left.-\frac{x\cos(nx)}{n}\right|_{0}^{\pi} + \frac{1}{n}\int_{0}^{\pi}\cos(nx)\,dx\right].
\end{equation*}
Evaluating gives
\begin{equation*}
b_n = \frac{2}{\pi}\left(-\frac{\pi\cos(n\pi)}{n} + \frac{\sin(n\pi)}{n^2}\right)
= \frac{2}{\pi}\left(-\frac{\pi(-1)^n}{n} + 0\right)
= 2\frac{(-1)^{n+1}}{n}.
\end{equation*}
Therefore the Fourier series is
\begin{equation*}
f(x) \sim 2\sum_{n=1}^{\infty}\frac{(-1)^{n+1}}{n}\sin(nx).
\end{equation*}
This series converges to \(f(x)=x\) for all \(x\in(-\pi,\pi)\text{,}\) and at the endpoints \(\pm\pi\) it converges to the midpoint of the left- and right-hand limits, i.e. to 0.
Interpretation: The result shows how an elementary function in the function space
\(C[-\pi,\pi]\) (with periodic extension) can be expressed as a linear combination of the orthogonal basis functions
\(\{\sin(nx),\cos(nx)\}\text{.}\) This is an instance of representing vectors (functions) in an infinite-dimensional function space by coordinates relative to a chosen basis.