Derivative of piece-wise function given by $x\sin\frac1x$ at $x=0$ Given the function:
$$f(x) = \begin{cases} x\cdot\sin(\frac{1}{x}) & \text{if $x\ne0$} \\ 0 & \text{if $x=0$} \end{cases}$$
Question 1: Is $f(x)$ continuous at $x=0$?
Question 2: What is the derivative of $f(x)$ at $x=0$ and how do I calculate it?
 A: Ad 1, $f$ is continuous at $x=0$ (and hence throuhout) for example because $|f(x)|\le |x|$ for all $x$, so that $\lim_{x\to0}f(x)=0=f(0)$.
Ad 2, we wish  to calculate $\lim_{h\to 0}\frac{f(0+h)-f(0)}{h}=\lim_{h\to 0}\sin\frac1h$, which does not exist (the expression oscillates between $-1$ and $1$, consider $h=\frac1{2k\pi\pm\pi/2}$ with $k\in\Bbb N$, for example.
A: Since $\sin(\frac 1 x) \in [-1, 1]$ for any $x \neq 0$, we find that 
$$ 0 \leq \vert f(x) \vert \leq \vert x \vert \; , \; \text{for any } x \neq 0 \; .$$
With the Squeeze Theorem, it follows, that 
$$ \lim_{x \to 0} f(x) = 0 = f(0)\; ,$$
so $f$ is continuous at $0$. 
To decide, if $f$ is differentiable at the point $0$, we can check, if the limit
$$ \lim_{h \to 0} \frac{f(h) - f(0)}{h} = \lim_{h \to 0} \frac{h \sin(\frac 1 h)}{h} = \lim_{h \to 0} \sin\left( \frac 1 h \right)$$
exists. Now, choose sequences $\{x_k\}$ and $\{ y_k \}$, such that $\lim_{k \to \infty} x_k = \lim_{k \to \infty} y_k = 0$, but
$$ \sin\left( \frac{1}{x_k} \right) = -1 \quad \text{and} \quad \sin\left( \frac{1}{y_k} \right) = 1 \; ,$$
for all $k \in \Bbb N$, which shows, that the limit above does not exist, so $f$ is not differentiable at $0$.
