a) $f(-2)=||-2-1|+2|=||-3|+2|=|3+2|=|5|=5$
$f(\dfrac{1}{2})=||\dfrac{1}{2}-1|+2|=||-\dfrac{1}{2}|+2|=|\dfrac{1}{2}+2|=|\dfrac{5}{2}|=\dfrac{5}{2}$
b) $f(x)=3\to ||x-1|+2|=3$
\(\to\left[ \begin{array}{l}|x-1|+2=3\to|x-1|=1(tm)\\|x-1|+2=-3\to |x-1|=-5(ktm)\end{array} \right.\)
$\to |x-1|=1$
\(\to\left[ \begin{array}{l}x-1=1\to x=2\\x-1=-1\to x=0\end{array} \right.\)
Vậy $x=\{2;0\}$