Let $$ f(x) = \begin{cases} x^2 \sin\left(\frac{1}{x}\right) & \text{if } x \neq 0 \\ 0 & \text{if } x=0\end{cases}$$ Is $f$ continuous? Is $f$ differentiable?
$\text{I know how to show that this function is differentiable}\\\text{ but is there a way to show that it is continuous? Should I use the three step continuity test?}$
$\\ \text{If x } \neq 0 \text{ then} \\ f'(x) = 2x\sin\frac{1}{x} + x^2 \cdot(\cos \frac{1}{x})\cdot\frac{1}{x^2} \\ = 2x\sin\frac{1}{x}-\cos\frac{1}{x}, x \neq 0 \\ f'(0) = ? \\ f'(0) = \lim \limits_{h \to 0} \frac{f(h)-f(0)}{h }\\ \lim \limits_{h \to 0} \frac{f(h)}{h } = \lim \limits_{h \to 0} \frac{h^2\sin \frac{1}{h}}{h} = \lim \limits_{h \to 0} h \sin h \\ h\neq 0 \\ 0 \le |h\sin\frac{1}{h}| \le |h| \\ \lim \limits_{h \to 0} |h| =0 \\ \lim \limits_{h \to 0} 0 =0 \\ \lim \limits_{h \to 0} |h \sin \frac{1}{h}| =0 \text{ pinching theorem} \\ \lim \limits_{h \to 0} h\sin\frac{1}{h} =0 \\ \text{i.e.} f'(0) =0 \\ \text{f is differentiable on } \mathbb R. \\ f'(x) = \begin{cases} 2x \sin \frac{1}{x} - \cos \frac{1}{x}, & x \neq 0 \\ 0, & x=0 \end{cases} \\ \text{ Is this enough to show that f is continuous?} $