So I'm starting to learn about continuity and I'm having a slight problem. I've had a look around online but can't really find the explanation I'm looking for. I've been looking at the classic example of a derivative which is not continuous:
$$f(x) = \begin{cases} x^2\sin(\frac{1}{x}) & \quad x\ne0 \\ 0 & \quad x=0 \end{cases} $$
I understand the process of using limits to check that $f(x)$ is continuous and differentiable, how to get to the conclusion that $f'(0) = 0$, and that the $\lim\limits_{x \to 0} (-\cos(\frac{1}{x})+2x \sin(\frac{1}{x}))$ does not exist.
What I don't understand is that if $f'(x)$ has no limit as $x$ appoaches $0$, then how can it be the case that we can calculate that $f'(0) = 0$? How have we managed to calculate the derivative at a point of discontinuity? Is the limit of the difference quotient used only to determine that $f(x)$ has a derivative at $0$ and is this result completely overruled by the fact that we have calculated there is a discontinuity at $x=0$. I thought the point of a discontinuity was that you couldn't do things like come up with an expression for its derivative.