Answer
$$f(x) = \begin{cases}-2x+2 & \text{ if }x <0 \\ 2 & \text { if } 0 \le x <2 \\ 2x-2 & \text { if } x \ge 2 \end{cases}$$
Work Step by Step
According to the definition of "absolute function", we have
$|x|= \begin{cases} x & \text{ if } x \ge 0 \\ -x & \text{ if } x <0 \end{cases}$
and
$|x-2|= \begin{cases} (x-2) & \text{ if } (x-2) \ge 0 \\ -(x-2) & \text { if } (x-2) < 0 \end{cases}\qquad \quad = \begin{cases} x-2 & \text { if } x \ge 2 \\ -x+2 & \text { if } x <2 \end{cases}\, .$
According to the above, we can write the function $f(x)$ as follows.
For $x < 0$,
$f(x)=|x| +|x-2|=-x +(-x+2) = -2x+2 \,;$
for $0 \le x <2$,
$f(x)= |x|+|x-2|=x+(-x+2)=2 \,;$
for $x \ge 2$,
$f(x)= |x|+|x-2|= x+(x-2)=2x-2 \, .$
Hence,
$$f(x) = \begin{cases}-2x+2 & \text{ if }x <0 \\ 2 & \text { if } 0 \le x <2 \\ 2x-2 & \text { if } x \ge 2 \end{cases} \, .$$