Find the number of real solutions Let $$f(x)=\frac{1}{2}( |x-a|+|x-b|),$$ where $x$ is a real number ; no information is given on $a$ and $b$.
Study the differentiability of this function and determine how many real solutions does the equation $\mathbf{f(x)=m}$ have, where $m$ is a real number. The problem asks us not to use plotting.
How do you solve this? I'm completely clueless, I don't even know where to start!

Suppose first that $a<b$.  Then $$f(x)=\frac{1}{2}\begin{cases}a+b-2x & x\le a \\ b-a & a<x<b \\ 2x-a-b & b\le x\end{cases}$$
Taking the derivative, we get $$f'(x)=\frac{1}{2}\begin{cases} -2 & x< a \\ 0 &a<x<b \\ 2 & b<x\end{cases}$$
You will note that there are discontinuities of $f'(x)$ at $a, b$; at these points $f(x)$ is not differentiable.
I leave the cases $a=b$ and $a>b$ for you to consider.
