3. Let $x, y, z \in [0,1]$, then the maximum value of $M=\sqrt{|x-y|}+\sqrt{|y-z|}+\sqrt{|z-x|}$ is $\qquad$ .
Solution: $\sqrt{2}+1$.
Assume $0 \leqslant x \leqslant y \leqslant z \leqslant 1$, then $M=\sqrt{y-x}+\sqrt{z-y}+\sqrt{z-x}$.
Since $\sqrt{y-x}+\sqrt{z-y} \leqslant \sqrt{2[(y-x)+(z-y)]}=\sqrt{2(z-x)}$,
we have $M \leqslant \sqrt{2(z-x)}+\sqrt{z-x}=(\sqrt{2}+1) \sqrt{z-x} \leqslant \sqrt{2}+1$.
Equality holds if and only if $y-x=z-y, x=0, z=1$, i.e., $x=0, y=\frac{1}{2}, z=1$. Therefore, $M_{\max }=\sqrt{2}+1$.