Limits and continuity of a derivative 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.
 A: Using MVT, you can prove easily that if $ f $ is continuous at $ [a,b] $ and differentiable at $ (a,b] $ with $$\lim_{x\to a^+}f'(x)= L \in \Bbb R $$
Then, $ f $ is differentiable at $ [a,b] $ and
$$f'(a)=L$$
Your counterexample simply proves that the Converse is not always true.
A: Suppose the derivative were defined as
$$ f^\dagger(x) = \lim_{y,z \to x} \frac{f(y) - f(z)}{y-z} ,$$
then $f(x) = x^2 \sin(\frac1x)$ wouldn't be differentiable at $x = 0$.  That is, you could find a sequence of points $y_n,z_n \to 0$ such that the slope between these points oscillates.  You could do this, for example, by making the distance between $x_n$ and $y_n$ much smaller than the distance between $x_n$ and $0$.  I think this definition would have been very reasonable, but that wasn't the one they chose.
I think this picture illustrated what is happening.  See that there is a sequence of points going to zero such that the slope between those points is definitely not close to 0.  But the derivative at 0 definitely is zero.

