$$g(x) = \sum_{n = 1}^{\infty} a_n \sin(nx)$$
$$h(x) = -\frac{a_1}{2 \pi } x $$
How to prove that $g(x) \ge h(x)$ on $ (0, \pi) $, where $a_n$ decreases to $0$ monotonically?
I tried to make a Fourier series from $R(x) = x$, I got $ \displaystyle R(x) = \sum_{n = 1}^{\infty} \frac{(-1)^n}{n} \sin(nx)$, so $\displaystyle h(x) = -\frac{a_1}{2 \pi } \sum_{n = 1}^{\infty} \frac{(-1)^n}{n} \sin(nx) $ but I don't know how to continue.
I don't see a way to use the Fourier series of $h$ (which you have slightly miscalculated, a factor of $-2$ is missing).
A summation by parts works, however. Note that
$$2\sin \alpha \sin \beta = \cos (\alpha - \beta) - \cos (\alpha + \beta),$$
so
\begin{align} 2 g(x) \sin (x/2) &= \sum_{n = 1}^{\infty} a_n \bigl(2\sin (nx) \sin(x/2)\bigr) \\ &= \sum_{n = 1}^{\infty} a_n\bigl(\cos \bigl((n-1/2)x\bigr) - \cos \bigl((n+1/2)x\bigr)\bigr) \\ &= \sum_{n = 1}^{\infty} a_n \cos \bigl((n-1/2)x\bigr) - \sum_{m = 2}^{\infty} a_{m-1}\cos \bigl((m-1/2)x\bigr) \\ &= a_1 \cos (x/2) - \sum_{m = 2}^{\infty} \bigl(a_{m-1} - a_m\bigr)\cos\bigl((m-1/2)x\bigr) \\ &\geqslant a_1 \cos (x/2) - \sum_{m = 2}^{\infty} (a_{m-1} - a_m) \\ &= a_1 \bigl(\cos (x/2) - 1\bigr). \end{align}
Since $\sin (x/2) > 0$ for $x \in (0,\pi)$, the inequality $g(x) \geqslant h(x)$ for $x\in (0,\pi)$ is equivalent to
$$ 2g(x)\sin (x/2) + \frac{a_1}{\pi} x\sin (x/2) \geqslant 0\tag{1}$$
there. From the above computation, it suffices to show
$$\frac{x}{\pi}\sin (x/2) + \cos (x/2) \geqslant 1\tag{2}$$
for $x \in (0,\pi)$, or, writing $x = 2y$,
$$f(y) := \frac{2}{\pi} y \sin y + \cos y \geqslant 1\tag{$2'$}$$
for $0 < y < \frac{\pi}{2}$. We see that $f(0) = f(\pi/2) = 1$, and compute
$$f'(y) = \frac{2}{\pi}y\cos y - \biggl(1 - \frac{2}{\pi}\biggr)\sin y.$$
For $0 < y < \frac{\pi}{2}$, $f'(y) = 0$ is equivalent to
$$\frac{2}{\pi-2}\cdot y = \tan{y},\tag{3}$$
and $(3)$ has a unique solution $y_0$ in that interval.
Since $f'(y) = \bigl(\frac{4}{\pi} - 1\bigr) y + O(y^2)$ near $0$, we see that $f'(y) > 0$ for $0 < y < y_0$ and $f'(y) < 0$ for $y_0 < y < \frac{\pi}{2}$. Thus $(2')$, equivalently $(2)$, and consequently $(1)$, follows.