Let $f(x) = x\sin(x)$ for $ x\in [-\pi,\pi)$, and similarly, denote by $f$ its periodisation. Recall that, since $f$ is differentiable over $(-\pi,\pi)$ and is $2\pi$ periodic function, we can write it as a Fourier series
$$
f(x) = \sum_{n=-\infty}^{\infty} c_n(f) e^{-inx}
$$
with Fourier coefficients defined as
$$
c_n(f) := \frac{1}{2\pi}\int_{-\pi}^{\pi}f(x)e^{inx} dx, \quad n \in \mathbb{Z}.
$$
Then, approaching similarly, we can define the Fourier coefficients of the derivative of $f$ as
$$
c_n(f') = \frac{1}{2\pi}\int_{-\pi}^{\pi} f'(x) e^{inx} dx \quad n \in \mathbb{Z}.
$$
with a corresponding Fourier series.
Relating Fourier Coefficients
Applying integration by parts, and assuming that $f$ is finite at the boundary, we find that
$$
\begin{align}
c_n(f') &= \frac{1}{2\pi}\int_{-\pi}^{\pi} f'(x) e^{inx} dx \\
&= \frac{1}{2\pi}\left[f(x)e^{inx}\Big\vert_{-\pi}^{\pi} - in\int_{-\pi}^{\pi}f(x)e^{inx} dx\right]
\\
\text{$n$ an integer so $e^{in\pi} = (-1)^n$, giving}\\
&= \frac{1}{2\pi}\left[\left(f(\pi^-)e^{in\pi} - f(-\pi^+)e^{-in\pi}\right) - in\int_{-\pi}^{\pi}f(x)e^{inx} dx\right] \\
&= \frac{1}{2\pi}\left[(-1)^n\left(f(\pi^-) - f(-\pi^+)\right) - in\int_{-\pi}^{\pi}f(x)e^{inx} dx\right]\\
\text{if $f$ periodic, then}\\
&=\frac{-in}{2\pi}\int_{-\pi}^{\pi}f(x)e^{inx} dx\\
&= -inc_n(f).
\end{align}
$$
This gives the nice relation between the Fourier coefficients between a function and its derivative, that being
$$
c_n(f') = -in c_n(f), \quad
$$
Note: This holds with the current definition of the Fourier coefficient, and may different up to a constant using other definitions.
Using the above you can proceed to find a solution to your question.
We can start by first computing the Fourier coefficients of the periodisation of your function $f(x) = x\sin(x)$ when $x\in (-\pi,\pi)$.
Indeed, we find that
$$
c_n(f) =
\begin{cases}
1 & \text{if } n = 0\\
-\frac{1}{4} & \text{if } n = \pm 1\\
-\frac{(-1)^{n}}{(n^2 - 1)} & \text{otherwise}.
\end{cases}
$$
Using the above work, we therefore find that
$$
c_n(g) =
\begin{cases}
0 & \text{if } n = 0\\
\frac{i}{4} & \text{if } n = 1\\
-\frac{i}{4} & \text{if } n = -1\\
\frac{in(-1)^{n}}{(n^2 - 1)} & \text{otherwise}.
\end{cases}
$$
Hence the Fourier series for $g(x)$ would be
$$
\begin{align}
g(x) &= \sum_{n=-\infty}^{\infty}c_n(g) e^{-inx} \\
&= \frac{i}{4}(e^{-ix} - e^{ix}) + \sum_{n=2}^{\infty}\frac{in(-1)^{n}}{(n^2-1)}e^{-inx} + \sum_{n=2}^{\infty}\frac{i(-n)(-1)^{-n}}{((-n)^2-1)}e^{inx} \\
&= \frac{i}{4}(e^{-ix} - e^{ix}) + \sum_{n=2}^{\infty}\frac{in(-1)^{n}}{(n^2-1)}(e^{-inx} - e^{inx}) \\
\text{using standard identities}\\
&= \frac{\sin(x)}{2} + 2\sum_{n=2}^{\infty}\frac{n(-1)^{n}}{(n^2-1)}\sin(nx),
\end{align}
$$
as required.
Note: You should keep in mind that different Fourier coefficient definitions also correspond to different Fourier series definitions.