TITLE: Uniform continuity of $f(x) = x \sin{\frac{1}{x}}$ for $x \neq 0$ and $f(0) = 0.$
QUESTION [17 upvotes]: 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.

REPLY [2 votes]: I think it is also uniformly continuous on $(0,1)$. If $(x_{n})$ and $(y_{n})$ are sequences that converge to 0, then since $\sin$ is bounded, $x_{n}\sin(1/x_{n})$ 
and $y_{n}\sin(1/y_{n})$ also converge to 0. Then the absolute value of their 
difference converge to 0 and this is sufficient for uniform continuity. 
Now, if $x_{n}\longrightarrow x$ and $y_{n}\longrightarrow y\Rightarrow |x_{n}-y_{n}|\longrightarrow |x-y|\underset{\text{if}}{=}0\Rightarrow x=y$. If those sequences do not converge to 0, then $x>0\Rightarrow [x-1/m,1-1/m]$ for an appropriate $m$. Since $x\sin(1/x)$ is continuous on that interval, then it's uniformly continuous there.