Consider the function:
$$f(x) = \begin{cases} 0 & x=0\\ |x^2\sin\frac1x| & x \neq 0 \end{cases}$$
I can easily verify that $\lim_{x \to 0} f(x) = 0$ using the squeeze theorem on $(-1, 1)$. So $f'(0)$ must exist.
On the other hand, the derivative is not defined at $x=0$.
I'm confused here. I understand that I've shown that $f(x)$ is continunous at $0$, but isn't the requirement for it to be differentiable the same in this particular case $$\lim_{x \to 0} \frac{f(x)-f(0)}{x-0} = \lim_{x \to 0} f(x)$$
Why is $f(x)$ not differentiable at $0$?