Example 3. Let the function $f(x)=-x^{2}+(2 m-4) x$ $-(m+1)$ have a maximum value of $g(m)$. Try to find the minimum value of $g(m)$.

保留了原文的换行和格式。
Given $f(x)=-\left[x-(m-2]^{2}+m^{2}\right.$ $-5 m+3$, we have
$$
\begin{aligned}
g(m) & =m^{2}-5 m+3 \\
& =\left(m-\frac{5}{2}\right)^{2}-\frac{13}{4} \geqslant-\frac{13}{4}
\end{aligned}
$$

Therefore, the minimum value of $g(m)$ is $-\frac{13}{4}$.