This animation shows that g(x) is differentiable at the origin. It shows the secant line through (0,g(0)) and (h,g(h)). The secant lines quickly approach the tangent line y=0 as h approaches 0.

What happens when you replace x2 with x?

\begin{displaymath}g(x) = \left\{
\begin{array}{cc}
x^2 \sin{\left(\frac{1}{x}\...
...mbox{ if } x \neq 0\\
0, &\mbox{ if } x=0
\end{array}\right. .\end{displaymath}

Like its relative \begin{displaymath}f(x) = \left\{
\begin{array}{cc}
x \sin{\left(\frac{1}{x}\ri...
...&\mbox{ if } x \neq 0\\
0, &\mbox{ if } x=0
\end{array}\right.\end{displaymath}, $ g(x)$ is continuous at the origin; as with $ f(x)$, you can prove this with the Squeeze Theorem. Unlike $ f(x)$, however, $ g(x)$ is also differentiable at the origin! The extra power of $ x$ is just enough to make the limit exist:

$\displaystyle g'(0)$ $\displaystyle = \lim_{h \rightarrow 0} \frac{g(0+h) - g(0)}{h} = \lim_{h \rightarrow 0} \frac{g(h) - 0}{h}$    
  $\displaystyle = \lim_{h \rightarrow 0} \frac{h^2 \sin \left(\frac{1}{h}\right) }{h} = \lim_{h \rightarrow 0} \frac{h \sin \left(\frac{1}{h}\right)}{1}$    
  $\displaystyle = \lim_{h \rightarrow 0} h \sin \left(\frac{1}{h}\right)$    
  $\displaystyle = 0$    

That last limit is evaluated with the Squeeze Theorem; it's actually exactly the same limit you need to evaluate to show that $ f(x)$ is continuous.

You can see visual evidence in the applet on the left that the derivative exists at the origin. Move your mouse over the picture to the left to start the animation; you may also have to click on the picture before it starts.