# Does the uniform continuity of $f: X \rightarrow \mathbb{R}$ imply $f: A \rightarrow \mathbb{R}$ is also uniformly continuous, when $A \subset X$?

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?

-
No, you're perfectly right. If $f: X \to \mathbb{R}$ is uniformly continuous then the restriction of $f$ to any subset $A \subset X$ is also uniformly continuous. This can be seen by writing the condition of uniform continuity on $X$ as $\forall\, \varepsilon \gt 0\;\exists\;\delta \gt 0: \forall\, x,y \in X : \ldots$. If you replace $X$ by $A$ and restrict $f$ to $A$ then the last condition becomes weaker as it then reads $\forall\,x,y \in A$. The "too strong" conclusions are correct. – t.b. Jul 4 '11 at 6:45
Thank you! I went back and thought about why I considered the conclusions "too strong", and I realized I was subconsciously only thinking about Lipschitz continuous functions. (Also, the statements gave off a sense of "if the conditions were this nice, they'd mention it in class" to me, which made me suspicious.) – JakeR Jul 4 '11 at 6:55
I hope you're aware that Lipschitz is much stronger than uniform continuity. One standard example for showing this is $x \mapsto \sqrt{x}$ on $[0,\infty)$ which is uniformly continuous but not Lipschitz (because the slopes become arbitrarily steep near the origin). – t.b. Jul 4 '11 at 6:57
Sadly, I can't claim that I wasn't conscious of that. I'm still not sure why I was implicitly assuming my functions were Lipschitz. – JakeR Jul 4 '11 at 7:13
There is a rather difficult theorem due to Rademacher indicating a further strong distinction between Lipschitz and uniform continuity: It asserts that a Lipschitz continuous function on $\mathbb{R}^{n}$ is differentiable "almost everywhere" (a precise technical term that should make sense intuitively), while you probably came across examples of continuous functions on $$0,1$$ that aren't differentiable anywhere. – t.b. Jul 4 '11 at 7:22

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$.
@JakeR: Yes that's it exactly. The precise statement is: Let $A \subset X$ be a subset of a metric space and let $Y$ be a complete metric space. If $f: A \to Y$ is uniformly continuous then there exists a unique extension of $f$ to a continuous function on $\overline{A}$. If $\overline{A}$ is compact then the condition is also necessary by your observations in your question. The proof proceeds exactly in the way you describe but of course you need to check continuity of the extension. – t.b. Jul 4 '11 at 7:09
Sorry, I had deleted the comment accidentally. We were talking about the condition above for continuous extensions, and I attempted a sketch of a proof: Let $x \in \overline{A}$ but not $A$. Consider sequences in $A$ converging to $x$: these sequences are Cauchy, and since $f$ is uniformly continuous, evaluating each of these sequences termwise by $f$ are also Cauchy. They converge uniquely (interweave two, and we have convergent subsequences in a Hausdorff space) to a point $y$. Associating $f(x) = y$, and doing this for all limit points, gives a continuous extension to $\overline{A}$. – JakeR Jul 4 '11 at 7:18
In regards to your "too strong" conclusions there's a slightly more general statement one can make. Let $f: (X,d_1) \rightarrow (Y,d_2)$ be a continuous function and $A \subset X$ compact. Consider $g:=f|_A$ then $g$ is continuous (with A given the metric induced from $X$). Then we have that $g$ is a continuous function whose domain is compact, so $g$ is uniformly continuous. That is $f$ is uniformly continuous on $A$.