Derivative of Function with Cases: $f(x)=x^2\sin x^{-1}$ for $x\ne0$

"The derivative of the cases is the cases of the derivatives", as you write, on any point internal to an interval on which a single case applies. But at any point where two intervals relative to two different cases meet the derivative might not even exist, even if it exists at any point arbitrarily near to it (and even if it approaches the same limit from the right and the left, in fact). Think about $g(x)$ defined as $1/x$ for $x\neq 0$ and as $0$ for $x=0$: is there a derivative in $0$?

To make this all more formal, check the definition of derivative as a limit, and note that in general you really need "a little space around" a point in which only a single case applies to find it.


How you concluded $f'(0)=0$ you made no attempt to explain. Remember that $$ f'(0) = \lim_{h\to0} \frac{ f(0+h) - f(0) } h. $$ You'll probably need to squeeze in order to find the limit. Next you have $$ f''(0) = \lim_{h\to0} \frac{f'(0+h) - f'(0)} h. $$ And again you'll probably have to squeeze. However, it's not hard to see without doing that, that $f'$ is not continuous at $0$ since it approaches no limit at $0$ because of the way it oscillates. Therefore it cannot be differentiable at $0.$