3. Let $x, y, z \in [0,1]$. Then
$$
M=\sqrt{|x-y|}+\sqrt{|y-z|}+\sqrt{|z-x|}
$$

The maximum value of $M$ is $\qquad$ .
3. $\sqrt{2}+1$.

Let's assume $0 \leqslant x \leqslant y \leqslant z \leqslant 1$. Then
$$
\begin{array}{l}
M=\sqrt{y-x}+\sqrt{z-y}+\sqrt{z-x} . \\
\text { By } \sqrt{y-x}+\sqrt{z-y} \\
\leqslant \sqrt{2[(y-x)+(z-y)]}=\sqrt{2(z-x)} \\
\Rightarrow M \leqslant(\sqrt{2}+1) \sqrt{z-x} \leqslant \sqrt{2}+1 .
\end{array}
$$

Equality holds if and only if $x=0, y=\frac{1}{2}, z=1$.