Example 5 Solve the inequalities: (1) $|2 x-1|>x+2$; (2) $|2 x-1| \leqslant x+2$.
Solve $|2 x-1|=\max \{2 x-1,-(2 x-1)\}$.
(1)
$$
\begin{aligned}
|2 x-1|>x+2 & \Leftrightarrow \max \{2 x-1,-(2 x-1)\}>x+2 \\
& \Leftrightarrow 2 x-1>x+2 \text { or }-(2 x-1)>x+2,
\end{aligned}
$$

Therefore, the solution set of the original inequality is $\left(-\infty,-\frac{1}{3}\right) \cup(3,+\infty)$.
(2)
$$
\begin{aligned}
|2 x-1| \leqslant x+2 & \Leftrightarrow \max \{2 x-1,-(2 x-1)\} \leqslant x+2 \\
& \Leftrightarrow\left\{\begin{array} { l } 
{ 2 x - 1 \leqslant x + 2 , } \\
{ - ( 2 x - 1 ) \leqslant x + 2 }
\end{array} \Leftrightarrow \left\{\begin{array}{l}
x \leqslant 3, \\
x \geqslant-\frac{1}{3},
\end{array}\right.\right.
\end{aligned}
$$

Therefore, the solution set of the original inequality is $\left[-\frac{1}{3}, 3\right]$.
Note: The solution set of (2) can also be obtained by finding the complement of the solution set of (1) in $\mathbf{R}$.
Key to solving the problem: The solution method utilizes $|a|=\max \mid a,-a\}$ to remove the absolute value symbol. This method has strong logicality.