By the Weierstrass M-test, there is uniform convergence on $[0,\pi]$ for
$$f(x) = \sum_{n=1}^\infty \frac{\sin(nx)}{n^2}$$
Exchanging limit and sum we have $f(x) \to 0$ as $x \to 0+$.
(1) Is it true that on $(0,\pi]$
$$f'(x) = \sum_{n=1}^\infty \frac{\cos(nx)}{n}$$
and $\lim_{x \to 0+} f'(x) = \infty?$
(2) What is
$$\lim_{x \to 0+} \frac{f(x)}{x} = \lim_{x \to 0+}\sum_{n=1}^\infty\frac{\sin(nx)}{n^2x} = ?$$
I see that
$$ \sum_{n=1}^\infty \lim_{x \to 0+}\frac{\sin(nx)}{n^2x} = \sum_{n=1}^\infty \frac{1}{n} = \infty $$
but switching limit and sum may not be permitted here.
My concern is sometimes in general we can have $f'(0)$ exist but have $f'(x)$ not continuous at $x = 0$.
Since, $\sum_{n=1}^N \cos(nx)$ is bounded on any compact subset of $(0,\pi)$, then Dirichlet's Test for uniform convergence guarantees that the series $\sum_{n=1}^\infty \frac{\cos(nx)}{n}$ uniformly converges for $x$ on any compact subset of $(0,\pi)$.
Therefore, we assert that for $x\in (0,\pi)$
$$\frac{d}{dx}\sum_{n=1}^\infty \frac{\sin(nx)}{n^2}=\sum_{n=1}^\infty \frac{\cos(nx)}{n}\tag 1$$
Note that the right-hand side of $(1)$ fails to exist at $x=0$.
Inasmuch as it represents the function $-\log\left(2\sin(x/2)\right)$ for $x\in(0,\pi)$, then the limit as $\lim_{x\to 0^+}\sum_{n=1}^\infty \frac{\cos(nx)}{n}=\infty$. And we are done!