Example 7. Let $a, b, m$ be integers, if $a$ and $m$ are coprime, find the value of the sum
$$
\begin{array}{l}
\left\{\frac{b}{m}\right\}+\left\{\frac{a+b}{m}\right\}+\left\{\frac{2 a+b}{m}\right\}+\cdots \\
+\left\{\frac{(m-1)}{m} \frac{a+b}{m}\right\} \text{. }
\end{array}
$$
We first prove that $\left\{\begin{array}{c}a x+b \\ m\end{array}\right\}$ when $x=0$, 
$1,2, \cdots, m-1$, they are all distinct.
Proof: If there exist $x_{1}, x_{2} \in\{0$, $1,2, \cdots, m-1\}$ such that
$$
\left\{\frac{a x_{1}+b}{m}\right\}=\left\{\frac{a x_{2}+b}{m}\right\},
$$

then $\frac{a x_{1}+b}{m}-\frac{a x_{2}+b}{m}$ is an integer,
i.e., $\frac{a\left(x_{1}-x_{2}\right)}{m}$ is an integer.
Since $m$ and $a$ are coprime, then $x_{1}-x_{2}$ is a multiple of $m$, but by the values of $x_{1}$ and $x_{2}$, we can prove $\left|x_{1}-x_{2}\right|<m$, thus $x_{1}-x_{2}=0$, which contradicts that $x_{1}$ and $x_{2}$ are different. Therefore, we can get
$$
\begin{array}{l}
\sum_{\mathrm{x}=0}^{\mathrm{m}-1}\left\{\frac{a x+b}{m}\right\}=\frac{0}{m}+\frac{1}{m}+\frac{2}{m}+\cdots \\
+\frac{m-1}{m}-\frac{m-1}{2} .
\end{array}
$$