Why is the derivative of $f(x) = x-(x^2-2x)$ not defined at $x= 0$?
For a function $f(x) = x-|x^2-2x|$, the differentiation is possible when is broken into a piece wise function. i.e.
$$f(x) =\begin{cases}x-(x^2-2x)&x^2-2x\ge0\\ x+(x^2-2x)&x^2-2x < 0\end{cases}$$
$$f'(x)=\begin{cases}1-(2x-2)&x^2-2x > 0\\ 1+(2x-2)&x^2-2x < 0\end{cases}$$
The derivative at $x=0$ is not defined. Why? Please explain.