I don't get it why my solution is wrong :
My solving :
$ f(x) = | x - 1 | + | x - 2 | + | x - 3 | $
When $ x\leq 1 $
$ f(x) = | x - 1 | + | x - 2 | + | x - 3 | = 0 $
= $ 6 -3x $
since $ x\leq 1 $
$ f(x)\leq 3 $ also it clear $ f(x)\geq 0 $
=> The min value is 0 .
I dont have to consider other cases, since 0 is the min value f(x) can take .
Book has given the answer : $ 2 $ .
The function $f$ is linear on each of the intervals $(-\infty,1]$, $[1,2]$, $[2,3]$ and $[3,+\infty)$. Since a linear function on an interval always attains its minimum at one of the endpoints of the interval, and $f(x) \to +\infty$ as $x \to \pm \infty$, the function $f$ must attain its minimum at one of $x = 1, 2, 3$. Since $f(1) = 3$, $f(2) = 2$ and $f(3) = 3$, the function $f$ attains a minimum of $2$ at $x = 2$.