Finding the derivative at a particular point So I've got this question and I'm not 100% if I've actually answered it correctly, would be appreciated if you can check it and tell me whether its correct if not can you tell me where I went wrong and where I can improve thanks! :)
Question
Find the derivative of the function
$$f(x)=\begin{cases}
x^2\sin(\frac{1}{x}), &x \neq 0 \\
0, & x=0
\end{cases}$$
at $x=0$
Working
$\lim_{h\to 0}\frac{f(h)-f(0)}{h}=\lim_{h\to 0} h^2\sin(\frac{1}{h})$
*Apply squeeze theorem.
$-1\leq\lim_{h\to 0}h^2\sin(\frac{1}{h})\leq1$
$\therefore \lim_{h\to 0}h^2(\frac{1}{-1})\leq\lim_{h\to 0}h^2\sin(\frac{1}{h})\leq\lim_{h\to 0}h^2(\frac{1}{1})$
$0\leq\lim_{h\to 0}h^2\sin(\frac{1}{h})\leq 0$
$\implies \lim_{h\to 0}h^2\sin(\frac{1}{h})=0$
 A: The work shown in the original posting goes in the right direction. However, there are some mistakes in it that are partially already covered in the comments, but a very important one is not (although it is inconsequential here):
It is correct that what needs to be evaluated is 
$$
\lim_{h\rightarrow 0}\frac{f(h)-f(0)}{h}
$$
but this is 
$$
\lim_{h\rightarrow 0}\frac{f(h)-f(0)}{h} = \lim_{h\rightarrow 0}\frac{h^2\sin(\frac1h)-0}{h} = \lim_{h\rightarrow 0} h\sin(\frac1h)
$$
In the work of the original posting this was incorrectly evaluated as $\lim_{h\rightarrow 0} h^2\sin(\frac1h)$.
In the original posting when applying the squeeze theorem, the term $\lim_{h\rightarrow 0} h^2\sin(\frac1h)$ was always in the middle of the 'squeeze', even in the starting line 
$$
-1 \le \lim_{h\rightarrow 0} h^2\sin(\frac1h) \le 1
$$
But this makes no sense, because you are already making statements about the limit, which you are just about to show (but haven't yet) that it is 0. In other words, how do you know that that limit is between -1 and 1? 
The squeeze theorem wants you to put the elements of the sequence under consideration between elements of other sequences that are hopefully easier to evaluate and hopefully converging against the same limit. So you have to ask yourself: How can I squeeze $h\sin(\frac1h)$ between sequences that converge to $0$?
What you do know is
$$
-1 \le \sin(\frac1h) \le 1
$$
or alternatively written
$$
|\sin(\frac1h)| \le 1.
$$
If you multiply both sides by the positive $|h|$ ($h$ can't be zero, obviously), you get
$$
|h\sin(\frac1h)| = |\sin(\frac1h)||h| \le |h|,
$$
or alternatively
$$
-|h| \le h\sin(\frac1h) \le |h|
$$
Since $\lim_{h\rightarrow 0} |h| = \lim_{h\rightarrow 0} -|h| = 0$, this successfully squeezes $h\sin(\frac1h)$ between two sequences converging to 0, so you finally get what you wanted to prove:
$$
\lim_{h\rightarrow 0} h\sin(\frac1h) = 0.
$$
Of course, this is a very detailed explanation. Most people are satisfied with something that is already stated in the comments, like "$|h\sin(\frac1h)| \le |h|$ and $\lim_{h \rightarrow 0} |h|=0$, so $\lim_{h\rightarrow 0} h\sin(\frac1h) = 0$ follows".
A: Clearly the function is differentiable away from $x=0$. Therefore, away from $0$, we have $$f'(x) = 2x \sin\left(\frac{1}{x}\right) - \cos\left( \frac{1}{x} \right).$$ Applying the squeeze theorem to $$2x \sin \left( \frac{1}{x} \right),$$ we see that the limit is indeed zero. Moreover, for $\cos(1/x)$, the limit does not exist. Therefore, the derivative is not continuous at $x=0$. 
