Example 3. Let $f(x)=\left\{\begin{array}{ll}0, & -1 \leqslant x<0, \\ 1, & 0<x \leqslant 1 .\end{array}\right.$ Find $\int_{-1}^{1} f(x) d x$.

 untranslated text is kept in its original format and alignment.
Solve $\because F(x)=\left\{\begin{array}{ll}0, & -1 \leqslant x \leqslant 0, \\ 1, & 0<x \leqslant 1 .\end{array}\right.$
By formula (*), we get
$$
\begin{array}{c}
\int_{-1}^{1} f(x) d x=\int_{-1}^{0} 0 \cdot d x+\int_{0}^{1} 1 \cdot d x \\
=F(0)-F(0+0)+F(0-0)-F(-1)=1 .
\end{array}
$$