L'Hôpital's rule does not apply?! Apparently, Rogawski's Calculus for AP contains the following problem:
108. Explain why L'Hôpital's rule does not apply to
$$ \lim_{x\rightarrow 0}\frac{x^2\sin\frac{1}{x}}{\sin x} $$
It seems to me that it does apply:
The L'Hôpital's rule says: if $\lim_{x\rightarrow c}f(x)=\lim_{x\rightarrow c}g(x)=0$ and both $f$ and $g$ are differentiable at $x=c$ and $g'(c)\ne 0$, then $\lim_{x\rightarrow c}\frac{f(x)}{g(x)}$ exists and is equal to $\frac{f'(c)}{g'(c)}$.
(Note that nothing is assumed about differentiability of $f$ and $g$ other than at $x=c$).


*

*Define the numerator $f(x)=x^2\sin\frac{1}{x}$ to be $f(0)=0$ at $x=0$. Now, both numerator $f$ and denominator $g(x)=\sin(x)$ are continuous at $x=0$ and their values are $f(0)=g(0)=0$.

*The numerator $f$ is differentiable at $x=0$ and the derivative is $f'(0)=0$ (the derivative itself is discontinuous at 0, but that is irrelevant - even the existence of the derivative at any point other than 0 does NOT matter). One can see that from the definition of the derivative:
$f'(0)=\lim_{h\rightarrow 0} \frac{h^2\sin\frac{1}{h}}{h} =
 \lim_{x\rightarrow 0} h\sin\frac{1}{h} = 0$ (see PS step 2 below).

*The denominator $g$ is differentiable at $x=0$ and the derivative is $g'(0)=\cos 0=1$.

*Thus the limit is $\frac{0}{1} = 0$.
What am I missing?
PS. Note that I am not asking why the limit is 0. That can be easily seen without L'Hôpital:


*

*$\lim_{x\rightarrow 0}\frac{x}{\sin x} = 1$:
this is the inverse of the standard limit $\lim_{x\rightarrow 0}\frac{\sin x}{x} = 1$.

*$\lim_{x\rightarrow 0} x  \sin\frac{1}{x} = 0$
because $\sin\frac{1}{x}$ is bounded and $\lim_{x\rightarrow 0} x = 0$,
this follows from Squeeze theorem.

*the Product Rule for Limits
implies that 
$$\lim_{x\rightarrow 0}\frac{x^2\sin\frac{1}{x}}{\sin x} = 
\lim_{x\rightarrow 0}x\sin\frac{1}{x} \times
\lim_{x\rightarrow 0}\frac{x}{\sin x} =
0 \times 1 = 0$$
PPS Here is the scan from the textbook:

 A: You have misstated L'Hopital's Rule.  It does not say $\lim_{x\to c}{f(x)\over g(x)}={f'(c)\over g'(c)}$ (with the usual assumptions on $\lim_{x\to c}f(x)$ and $\lim_{x\to c}g(x)$).  It says
$$lim_{x\to c}{f(x)\over g(x)}=\lim_{x\to c}{f'(x)\over g'(x)}$$
provided the latter limit exists.  In this case
$${f'(x)\over g'(x)}={2x\sin(1/x)-\cos(1/x)\over\cos x}$$
for $x\not=0$.  So even though $f'(0)=\lim_{x\to0}{f(x)-f(0)\over x}=\lim_{x\to0}x\sin(1/x)=0$ (assuming we let $f(0)=\lim_{x\to0}f(x)=0$), the hypotheses of L'Hopital's Rule are not fulfilled because $\lim_{x\to0}(f'(x)/g'(x))$ does not exist.  In particular $\cos(1/x)$ has no limit as $x\to0$.
A: The proof of l'Hopital that the book uses is probably based on the extended mean value theorem,
$$
\frac{f(x)-f(c)}{g(x)-g(c)}=\frac{f'(\tilde x)}{g'(\tilde x)}
$$
for some $\tilde x$ between $c$ and $x$. This way of replacing the limit with a limit allows to apply the theorem repeatedly. It ignores that one can also reformulate it as a quotient of difference quotients,
$$
\lim_{x\to c}\frac{f(x)-f(c)}{g(x)-g(c)}=\frac{\lim_{x\to c}\frac{f(x)-f(c)}{x-c}}{\lim_{x\to c}\frac{g(x)-g(c)}{x-c}}=\frac{f'(c)}{g'(c)}
$$
which exists if both functions are differentiable at $x=c$ and $g'(c)\ne0$.
Now when the derivatives are not continuous, one can not conclude about the limit as the book expects. Thus the explored situation is not covered by the assumptions of the used theorem.

In general I find it often more instructive to use the mean value theorem (or Taylor expansion) than l'Hopital.
A: The problem is your  $f(x) = x^2 \sin \dfrac 1x$ is not differentiable at $0$, because $f$ is not even defined at $0$. A definition of the derivative is $\lim_{x \to a} \dfrac {f(x) - f(a)}{x-a}$, so as you can see it is required that $f$ be defined at $a$.
