Uniform continuity of $f(x) = x \sin{\frac{1}{x}}$ for $x \neq 0$ and $f(0) = 0.$ For the $f(x) = x \sin{\frac{1}{x}}$ for $x \neq 0$ and $f(0) = 0,$ my text book asks the following questions.
(b) Why is $f$ uniformly continuous on any bounded subset of $\mathbb{R}$? 
(c) Is $f$ uniformly continuous on $\mathbb{R}$??
The graph for the function is this.

For the question (b), if I take subset between $[0.2,0.6]$ or the subset where the slope is steep, I don't think the function is uniformly continuous because I think for a given $\epsilon>0$, there is no unique $\delta >0$ for the bounded subset. Therefore, it also cannot be uniformly continuous on $\mathbb{R}.$ However, the questions sounds like the function is uniformly continuous and the book says that it is uniformly continuous. The answer on the book says something but I need more explanation. Thanks. 

Would anyone be so kind as to critique the following direct demonstration that $\displaystyle x \sin \frac{1}{x}$ is uniformly continuous on $(0,1)$ ?
Let $\epsilon > 0$ and let $x, y \in (0,1)$.
Then
\begin{align*}
x\sin\frac{1}{x} - y \sin\frac{1}{y}
&= x\sin\frac{1}{x} - y\sin\frac{1}{x} + y\sin\frac{1}{x} - y \sin\frac{1}{y} \\
&= (x-y)\sin\frac{1}{x} + y \left ( \sin\frac{1}{x} - \sin\frac{1}{y} \right ),
\end{align*}
so
\begin{equation}
\label{eq: star}
\left | x\sin\frac{1}{x} - y \sin\frac{1}{y} \right |
\leq |x - y| + y \left | \sin\frac{1}{x} - \sin\frac{1}{y} \right |.
\end{equation}
But
\begin{align}
\label{eq: starstar}
\left | \sin\frac{1}{x} - \sin\frac{1}{y} \right |
&= \left | 2 \cos \left ( \frac{1}{2} \left ( \frac{1}{x} + \frac{1}{y} \right ) \right ) \sin \left ( \frac{1}{2} \left ( \frac{1}{x} - \frac{1}{y} \right ) \right ) \right | \notag \\
&\leq 2 \left | \sin \frac{y-x}{2xy} \right | \notag \\
&\leq \frac{|y - x|}{|xy|} \notag \\
&= \frac{|x - y|}{xy}.
\end{align}
By \eqref{eq: star} and \eqref{eq: starstar} we have
\begin{equation}
\label{eq: potato}
\left | x \sin\frac{1}{x} - y \sin\frac{1}{y} \right |
\leq |x-y| + \frac{|x-y|}{x}
=|x-y| \left ( 1 + \frac{1}{x} \right ).
\end{equation}
By symmetry, we also have
\begin{equation}
\label{eq: banana}
\left | x \sin\frac{1}{x} - y \sin\frac{1}{y} \right |
\leq |x-y| \left ( 1 + \frac{1}{y} \right ).
\end{equation}
Now let $\gamma > 0$. \
\noindent
\textbf{Case I:}
Suppose $x \geq \gamma$ or $y \geq \gamma$.
Then \eqref{eq: potato} and \eqref{eq: banana} imply that
\begin{equation}
\left | x \sin\frac{1}{x} - y \sin\frac{1}{y} \right |
\leq |x-y| \left (1 + \frac{1}{\gamma} \right ),
\end{equation}
so we should let $\displaystyle \delta = \frac{\epsilon}{1 + \frac{1}{\gamma}}$. \
\noindent
\textbf{Case II:}
Suppose instead that $x < \gamma$ and $y < \gamma$.
Then $\displaystyle \left | x \sin\frac{1}{x} - y \sin\frac{1}{y} \right |$ equals either $\displaystyle x \sin\frac{1}{x} - y \sin\frac{1}{y}$ or $\displaystyle y \sin\frac{1}{y} - x \sin\frac{1}{x}$.
But
\begin{equation}
x \sin\frac{1}{x} - y \sin\frac{1}{y}
\leq x - (-y)
= x + y
< 2 \gamma,
\end{equation}
and similarly,
\begin{equation}
y \sin\frac{1}{y} - x \sin\frac{1}{x} < 2 \gamma,
\end{equation}
hence
\begin{equation}
 \left | x \sin\frac{1}{x} - y \sin\frac{1}{y} \right | < 2 \gamma,
\end{equation}
so we should set $\displaystyle \gamma = \frac{\epsilon}{2}$.
\noindent
To summarise, let
\begin{equation}
\delta = \frac{\epsilon}{1 + \frac{1}{\epsilon/2}}
= \frac{\epsilon}{1 + \frac{2}{\epsilon}}
= \frac{\epsilon^2}{\epsilon + 2}.
\end{equation}
Then
\begin{equation}
|x-y| < \delta \Rightarrow \left | x \sin \frac{1}{x} - y \sin \frac{1}{y} \right | < \epsilon.
\end{equation}
\noindent
Therefore $\displaystyle h(x) = x \sin \frac{1}{x}$ is uniformly continuous on $(0,1)$.
