TITLE: Does the uniform continuity of $f: X \rightarrow \mathbb{R}$ imply $f: A \rightarrow \mathbb{R}$ is also uniformly continuous, when $A \subset X$?
QUESTION [8 upvotes]: I've been preparing for the prelim in August, and was working on a problem involving uniform continuity and restriction of functions.  I absentmindedly assumed the above by considering the contrapositive: if $f: A \rightarrow \mathbb{R}$ isn't uniformly continuous, that implies $\exists \ \epsilon$ such that no $\delta$ satisfies $d(x,y) < \delta \implies d(f(x),f(y)) < \epsilon, \,\,\ \forall x,y \in A$, and this failure of $\epsilon$'s existence shouldn't change when I "add more points" by considering $f: X \rightarrow \mathbb{R}.$  
However, if this is true, we obtained a lot of results I consider to be strangely powerful.  For example, if a function is continuous on $\mathbb{R}$, it is uniformly continuous on any bounded interval I, as it's uniformly continuous on $\overline{I}$ which is compact by Heine-Borel.  Hence, if $f$ is a real-valued function continuous on a subset $A$ of $R$, it's uniformly continuous on any bounded subset $X$ of $A$.  
Conclusions such as this seem too strong! Is there a flaw in my reasoning, and if so, where is it?

REPLY [6 votes]: It is true, and your conclusion that every continuous $f:\mathbb{R}\to\mathbb{R}$ is uniformly continuous on bounded subsets of $\mathbb{R}$ is also correct.
One could go further in saying precisely why it is true, which might help to convince you.  Suppose $f:X\to \mathbb{R}$ is uniformly continuous and $A\subset X$.  Given $\varepsilon>0$, by uniform continuity of $f$ there exists $\delta>0$ such that for all $x,y\in X$, $d(x,y)<\delta$ implies $d(f(x),f(y))<\varepsilon$.  Now this same $\delta$ works for the restriction $f\vert_A$, because if you have $x,y\in A$ with $d(x,y)<\delta$, then $x$ and $y$ are also in $X$, so $d(f(x),f(y))<\varepsilon$.