31. Given the function $f(x)=\left|\sin x+\frac{2}{3+\sin x}+b\right|$, the maximum value of $f(x)$ is $g(b)$. Find the minimum value of $g(b)$.
31. Let $t=3+\sin x$, then $2 \leqslant t \leqslant 4$, let $h(t)=t+\frac{2}{t}, t \in[2,4]$

Then $h(t)$ is monotonically increasing on $[2,4]$.
So $3 \leqslant h(t) \leqslant \frac{9}{2}$.
So $g(b)=\max \{|h(t)+b-3|\}=\max \left\{|b|,\left|b+\frac{3}{2}\right|\right\}$. (Consider $g_{1}(b)=h(t)+b-3$ as a linear function of $b$)
So $g(b) \geqslant \frac{1}{2}\left(|b|+\left|b+\frac{3}{2}\right|\right) \geqslant \frac{1}{2}\left|b-\left(b+\frac{3}{2}\right)\right|=\frac{3}{4}$, and the equality holds when $b=-\frac{3}{4}$.
So $g(b)_{\min }=\frac{3}{4}$.