The function $f(x)=|x|+||x-1|+|x-2|$ is
Answer & explanation
Correct answer: option 4
This function can be rewritten as $f(x)=\begin{cases}
x+x-1+x-2=3x-3 & \text{if}{\hspace .2cm} x\geq 2\\
x+(x-1)-(x-2)=x+1 & \text{if}{\hspace .2 cm} 1\leq x \leq 2\\
x+(1-x)+(2-x)=3-x & \text{if}{\hspace .2 cm} 0\leq x \leq 1\\
-x+1-x+2-x=3-3x & \text{if}{\hspace .2 cm} x<0
\end{cases}$
Now $\lim_{x\to 2+}f(x)-f(2)/x-2=\lim_{x \to 2}3x-6/x-2=3$ but $\lim_{x\to 2+}f(x)-f(2)/x-2=\lim_{x \to 2}x+1-3/x-2=1$. So $f'(2)$ does not exist. Similarly $f'(1)$ and $f'(0)$ does not exist.