Derivative of Function with Cases: $f(x)=x^2\sin x^{-1}$ for $x\ne0$ So far I assumed the derivative of a function with cases such as this one:
$$f(x) = \begin{cases}x^2\sin x^{-1} & \text{ if } x \neq 0\\ 0 & \text{ else }\end{cases}$$ would be the cases of the derivatives.
So, for $f'$ I would get:
$$f'(x) = \begin{cases} 
  2x \sin{\left( \frac{1}{x} \right)} -\cos{\left( \frac{1}{x} \right)} & \text{if } x \neq 0\\
  0 & \text{else}
\end{cases}$$
And for $f''$
$$f''(x) = \begin{cases} 
  \frac{(2x^2 - 1)\sin{\left( \frac{1}{x} \right)} - 2x\cos{\left( \frac{1}{x} \right)}}{x^2} & \text{if } x \neq 0\\
  0 & \text{else}
\end{cases}$$
However, supposedly $f$ is only differentiable once and not twice. Therefore I must have made a mistake here, but I am at a loss as to what that would be. Is the derivative of cases not the cases of the derivatives?

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.$
