Maximum and minimum of of $f(x)=|x-1|+|x-2|+|x-3|$ I am trying to find the maximums or minimums of $$f(x)=|x-1|+|x-2|+|x-3|$$ (if there exist).
My attempt: First I compute the derivative and tried to find critical point, i.e, $f'(x) = \frac{x-1}{|x-1|} + \frac{x-2}{|x-2|} + \frac{x-3}{|x-3|}=0$, first I noted that this derivative doesn't exist in 1,2,3 for the absolute value. And the are no critic point (Is that correct?)
Then I stuck here because I don't know if there is a maximum, I think that it is not exist but how can I justified and I believe that there is a global minimum, but this occurs only if I found a critical point, some help pls.
 A: From the fact that $|x|=\pm x$ depending on the sign of $x$, you can infer that the given function is continuous and piecewise linear.
A linear function has no critical points and achieves its minimum/maximum value at the endpoints of its definition domain.
We have $f(-\infty)=\infty,f(1)=3,f(2)=2,f(3)=3,f(\infty)=\infty$. You should be able to conclude.

An extremum can arise at a point that has no derivative: it suffices that the function be continuous, increasing on one side and decreasing on the other, i.e. have derivatives of opposite signs.
A: For positive $x \geq 3$ the function simply becomes $ y = (x-1) + (x-2) + (x-3) = 3x-6$. (this holds because everything is positive!)
For $2\leq x \leq 3$ we get $y= (x-1)+(x-2) + (3-x) = x$.  (note that when the inside of the absolute value is negative we can remove the absolute value by taking the opposite of the inside,  I.e $|n-k| = (k-n)$ when $k \geq n$ and equals $(n-k) $ when $n\geq k$)
Keep analyzing the function in intervals this way and find the minimums,  then compare! You'll find a global minimum at $x=2$  
Note:
While there are no points where the derivative is zero,  remember that when finding critical points on an interval you check everywhere the derivative is zero,  the derivative does not exist,  and the endpoints! 
A: We have $$f(x)=|3-x|+|x-1|+|x-2|\geq |3-x+x-1|+|x-2|=|2|+|x-2|\geq2$$ using the triangle inequality. But also $f(2)=2$. So it is a minimum.
