$\epsilon$-$\delta$ proof that $f(x) = x \sin(1/x)$, $x \ne 0$, is continuous

I’m doing an exercise that asks me to prove that $f$ is continuous using a $\epsilon$-$\delta$ proof. I have that
$$
f(x) = \begin{cases}
x\cdot \sin \frac1x,&x\neq 0
\\
0,&x = 0
\end{cases}
$$
I’ve already managed to show this property for $x=0$. How can I show it for $x \ne 0$, also using a $\epsilon$-$\delta$ proof?

Thank you very much.

Solutions Collecting From Web of "$\epsilon$-$\delta$ proof that $f(x) = x \sin(1/x)$, $x \ne 0$, is continuous"

Let $a\neq 0$. By the triangle inequality,
$$\begin{array}{ccc}
\left|f(x)-f(a)\right| &=& \left|x\sin \frac1x-a\sin \frac1a\right| \\
&=& \left|x\sin \frac 1x-a\sin \frac 1x+a\sin \frac 1x-a\sin \frac1a\right| \\
&\le& \left|x-a\right|\left|\sin \frac 1x\right|+a\left|\sin \frac 1x-\sin \frac1a\right| \\
&<& \delta+a\left|\sin \frac 1x-\sin \frac1a\right|
\end{array}$$
It all comes down to bounding the second term. By the trigonometric identity
\begin{equation}\sin \alpha-\sin \beta=2\sin \frac{\alpha-\beta}2\cos \frac{\alpha+\beta}2\end{equation}
we have
$$\begin{array}{ccc}
\left|\sin \frac 1x-\sin \frac1a\right| &=&
\left|2\sin \frac{\frac1x-\frac1a}{2}\cos\frac{\frac1x+\frac1a}{2} \right| \\
&=& 2\left|\sin \frac{x-a}{2xa}\cos\frac{x+a}{2xa} \right| \\
&\le& 2\left|\sin \frac{x-a}{2xa}\right|\end{array}$$

Because $\left|\sin \alpha\right|\le \alpha$,
\begin{equation}2\left|\sin \frac{x-a}{2xa}\right|\le 2\left|\frac{x-a}{2xa}\right|=\frac{\left|x-a\right|}{\left|x\right|\left|a\right|}\end{equation}
As $\left|x-a\right|<\delta\implies \left|x\right|>\left|a\right|-\delta$, the situation is simplified if we choose $\delta<\frac{\left|a\right|}2$. Then,
\begin{equation}\left|x-a\right|<\delta\implies \left|x\right|>\left|a\right|-\delta>\frac{\left|a\right|}2\implies \frac1{\left|x\right|}<\frac{2}{\left|a\right|}\end{equation}
and so
\begin{equation}\left|\sin \frac 1x-\sin \frac1a\right|\le\frac{\left|x-a\right|}{\left|x\right|\left|a\right|}<\frac{2\delta}{a^2}\end{equation}
I belive you can finish this off.

The function $f$ is continuous on $\Bbb R$ if and only if it is continuous at any point of $\Bbb R$. Since
$$
f(x) = a(x)b(x)
$$
for $x\neq 0$ and functions $a,b$ are continuous for $x\neq 0$, their product $f$ is also continuous for any $x\neq 0$.