Assume that $\sin\colon \mathbb{R} \rightarrow \mathbb{R}$ is continuous. Hint: consider using the Sandwich Lemma.
i) Show that the function $f(x) = \begin{cases} \text{sin}(\frac{1}{x}), & \text{if $x \ne 0$} \\ 0, & \text{if $x = 0$} \end{cases}$ is not continuous at $0$.
ii) Show that the function $f(x) = \begin{cases} x\text{sin}(\frac{1}{x}), & \text{if $x \ne 0$} \\ 0, & \text{if $x = 0$} \end{cases}$ is continuous everywhere, and not differentiable at $0$.
I'm having a bit of trouble proving these 2 problems using formal definitions. For i), I thought that if the limit at $a$ does not exist, then the function is not continuous at $a$, but after looking at some posts that does not seem to be the case. Does i) have something to do with the composition of continuous functions? If $f$ and $g$ are continuous at $0$, then $f(g)$ is also continuous at $0$. Since $g(x) = \frac{1}{x}$ is not continuous at $0$, does that necessarily mean $f(g)$ cannot be continuous at $0$ as well? It seems to make sense to me, but I can't really prove it (if it even is correct).
For ii), I'm completely lost. I don't see how that function is even continuous everywhere.
Any help or guidance on understanding these 2 problems would be greatly helpful. Thank you.