Example 6 Let the functions $f(x)=\ln x, g(x)=\frac{1}{2} x^{2}$. If $x_{1}>x_{2}>0$, for what value of $m(m \in \mathbf{Z}, m \leqslant 1)$ is it always true that
$$
m\left(g\left(x_{1}\right)-g\left(x_{2}\right)\right)>x_{1} f\left(x_{1}\right)-x_{2} f\left(x_{2}\right)
$$

holds.
Introduce an auxiliary function
$$
t(x)=m g(x)-x f(x)=\frac{m}{2} x^{2}-x \ln x \quad (x>0) \text {. }
$$

By the problem, $x_{1}>x_{2}>0$.
Therefore, if the original inequality always holds for $x>0$, i.e., the function $t(x)$ is monotonically increasing, then
$$
t^{\prime}(x)=m x-\ln x-1 \geqslant 0
$$

always holds.
Thus, $m \geqslant \frac{\ln x+1}{x}$ always holds, which means
$$
m \geqslant\left(\frac{\ln x+1}{x}\right)_{\max } \text {. }
$$

Introduce another auxiliary function
$$
h(x)=\frac{\ln x+1}{x} \quad (x>0) \text {. }
$$

By $h^{\prime}(x)=\frac{-\ln x}{x^{2}}$, we know that the function $h(x)$ is monotonically increasing on $(0,1]$ and monotonically decreasing on $(1,+\infty)$, i.e.,
$$
h(x)_{\max }=h(1)=1 \quad (m \geqslant 1) .
$$

Since $m \in \mathbf{Z}, m \leqslant 1$, hence $m=1$.