Let $f : \mathbb{R} \rightarrow \mathbb{R}$ be a differentiable function such that $f(0) = 0$, $f\left(\frac{\pi}{2}\right) = 3$ and $f'(0) = 1$. If
$$g(x) = \int_x^{\frac{\pi}{2}} \left[f'(t)\operatorname{cosec} t - \cot t\operatorname{cosec} t\, f(t)\right] dt$$
for $x \in \left(0, \frac{\pi}{2}\right]$, then $\lim_{x \rightarrow 0} g(x) =$