You have shown correctly with the Dirichlet test that $(g_n)$ converges uniformly on the interval $[\delta, \pi]$ for any $\delta > 0$. This relies on the fact that $\left|\sum_{k=1}^n \sin kx \right| \leqslant 1 / \sin (\delta/2)$ is uniformly bounded for all $n \in \mathbb{N}$ and $x \in [\delta,\pi]$.
However, if $\delta = 0$ the partial sums are not bounded and the Dirichlet test is not applicable. This is a clue that convergence is not uniform on $[0,\pi]$.
If the convergence were uniform, then by the Cauchy criterion for any $\epsilon > 0$ there exists $N \in \mathbb{N}$ such that for all $m > n \geqslant N$ and all $x \in [0,\pi]$ we would have
$$\tag{1}\left|\sum_{k=n+1}^{m}\frac{\sin kx }{k} \right| < \epsilon$$
We can show that this criterion is violated and the convergence is not uniform. Take $\epsilon = 1/(4\sqrt{2})$ and, for any integer $N$, no matter how large, choose $n = N$, $m = 2n$ and $x_n = \pi/(4n) \in [0,\pi]$. For any $k > n$, we have $kx_n > \pi/4$ and $\sin kx_n > \sin (\pi/4) = 1/\sqrt{2}$.
Hence,
$$\tag{2}\left|\sum_{k=n+1}^{2n}\frac{\sin kx_n }{k} \right| > \frac{1}{\sqrt{2}}\sum_{k=n+1}^{2n}\frac{1 }{k} > \frac{1}{\sqrt{2}}\cdot n \cdot \frac{1}{2n} = \frac{1}{2\sqrt{2}} > \epsilon,$$
and we have a contradiction to condition (1).
Your beginning is good: Show that on step functions, the claim is true, and then try and generalize. Here is probably the simplest way to approximate a generic function with step functions.
First, the monotone convergence theorem will probably be hard to use here, since the $g_n$ are not non-negative functions. So, instead we approach things differently. It is true that step functions are dense in $L^1$: for every $\epsilon > 0$ and $f \in L^1,$ you can find a step function $s$ so that $\int_0^1 |f - s| < \epsilon.$
(Here's one idea on how to do this approximation. First, recall that simple functions are dense in $L^1,$ and so it suffices to argue that the characteristic function of an arbitrary measurable set is well-approximated by a step function. But this is easy, since by definition of the Lebesgue outer measure, we can find a cover of our measurable set by intervals, so that the measure of the interval cover comes arbitrarily close to the measure of our set.)
Anyways, with this approximation in hand, just notice that
$$\int_0^1 |fg_n - sg_n| \leq \int_0^1 |g_n| \cdot |f-s| \leq C\epsilon.$$
Hence, since you've already shown that for all step functions $s,$ the integral $\int_0^1 sg_n \rightarrow 0,$ you can conclude the claim in general (specifically, you can show that the limsup of $\left|\int_0^1 fg_n\right|$ is bounded above by $C\epsilon$ for every $\epsilon > 0,$ so that letting $\epsilon \rightarrow 0$ you recover the desired statement).
This is a fairly common technique for proving identity about $L^p$ or other function spaces: Never ever ever work with an arbitrary function. Instead, prove it for some easy to work with class of functions (for $L^1$ usually step functions or simply functions are a good choice, and for general spaces usually continuous functions with compact support are a good choice), then approximate arbitrary functions by your 'nice' functions. Never work hard! Almost always you can find some large family of functions for which the claim is trivial (like here with step functions), and then use an easy approximation argument.
Best Answer
You have taken a good first step in showing that $g_n(x) \to g(x)$ uniformly on the interval $[\delta,\pi]$ for any $\delta$ where $0 < \delta < \pi$.
However, as proved here, convergence is not uniform on $[0,\pi]$ and we can't use the standard theorem to conclude immediately that
$$\tag{*}\lim_{n \to \infty}\int_0^\pi g_n(x) dx = \int_0^\pi g(x) dx$$
Nevertheless, we can prove (*) holds using the additional fact that the sequence of partial sums is uniformly bounded -- that is, there exists $M > 0$ such that
$$|g_n(x)| = \left|\sum_{k=1}^n \frac{\sin kx}{k} \right|\leqslant M$$
for all $n \in \mathbb{N}$ and all $x \in [0,\pi]$. For a proof of this fact, which is not trivial to show, see here. Furthermore, because $g_n(x) \to g(x)$ pointwise, it follows that $|g(x)| \leqslant M$ for all $x \in [0,\pi]$.
We can write
$$\left|\int_0^\pi (g_n(x) - g(x)) \, dx \right| =\left|\int_0^\delta (g_n(x) - g(x)) \, dx + \int_\delta^\pi (g_n(x) - g(x)) \, dx \right| \\ \leqslant \int_0^\delta |g_n(x)| \, dx + \int_0^\delta |g(x)| \, dx + \left|\int_\delta^\pi (g_n(x) - g(x)) \, dx \right| $$
Using the bounds $|g_n(x)|, |g(x)| \leqslant M$ we find that the first and second integrals on the RHS are each bounded by $M \delta$. Choosing $\delta \leqslant \epsilon/(4M)$ we get
$$\left|\int_0^\pi (g_n(x) - g(x)) \, dx \right| \leqslant 2M\delta + \left|\int_\delta^\pi (g_n(x) - g(x)) \, dx \right| \leqslant \frac{\epsilon}{2} + \left|\int_\delta^\pi (g_n(x) - g(x)) \, dx \right| $$
Since $g_n \to g$ uniformly on $[\delta,\pi]$, it follows that $\int_\delta^\pi g_n(x) \to \int_\delta^\pi g(x) \, dx$ and given $\epsilon > 0$ there exists $N$ such that for all $n > N$ we have $\left|\int_\delta^\pi (g_n(x) - g(x)) \, dx \right| < \epsilon/2$.
Therefore, for all $n > N$ we have
$$\left|\int_0^\pi g_n(x)\, dx -\int_0^\pi g(x)\, dx\right|= \left|\int_0^\pi (g_n(x) - g(x)) \, dx \right| \leqslant \frac{\epsilon}{2} + \frac{\epsilon}{2} = \epsilon,$$
and (*) is true.