Consider, f(x) = |x-1| + |x-2|
Let’s discuss the continuity of f(x).
We have, f(x) = |x-1| + |x-2|
When x<1, we have f(x) = -2x+3, which is a polynomial function and polynomial function is continuous everywhere.
When 1≤x<2, we have f(x) = 1, which is a constant function and constant function is continuous everywhere.
When x≥2, we have f(x) = 2x-3, which is a polynomial function and polynomial function is continuous everywhere.
Hence, f(x) = |x-1| + |x-2| is continuous everywhere.
Let’s discuss the differentiability of f(x) at x=1 and x=2.
We have
⇒ f(x) is not differentiable at x=2.
Thus, f(x) = |x-1| + |X-2| is continuous everywhere but fails to be differentiable exactly at two points x=1 and x=2.