# Continuous functions as uniformly continuous function

Three question concerninng metrics on the real line:

Is there a metric $d$ on $\Bbb{R}$ such that a function $f : (\Bbb{R},d) \longrightarrow (\Bbb{R},d)$ ( or $f : \Bbb{R} \longrightarrow (\Bbb{R},d)$ or $f : (\Bbb{R},d) \longrightarrow \Bbb{R}$) is continuous if and only if $f : \Bbb{R} \longrightarrow \Bbb{R}$ is uniformly continuous ?

EDIT: The answer now applies to arbitrary topologies, using an idea by Pietro Majer from the comments.

Proposition: There are no topologies $\tau_0,\tau_1$ on $\mathbb R$ such that $f\colon\mathbb R\to\mathbb R$ is uniformly continuous in the Euclidean metric iff $f\colon(\mathbb R,\tau_0)\to(\mathbb R,\tau_1)$ is continuous.

Proof: $\tau_1$ cannot be indiscrete (lest all functions are uniformly continuous), hence we can fix a $\tau_1$-closed set $F$ and points $a\in F$, $b\notin F$. For every Euclidean closed set $A$ and $c>0$, let $f_c(x)=a+c\operatorname{dist}(x,A)$. Then $f_c$ is uniformly continuous, hence continuous from $(\mathbb R,\tau_0)$ to $(\mathbb R,\tau_1)$, hence the $\tau_0$-closed set $f_c^{-1}(F)$ includes $A$ and excludes all points of Euclidean distance $(b-a)/c$ from $A$. The intersection of such sets for all $c$ is just $A$. This shows that $A$ is $\tau_0$-closed, i.e., $\tau_0$ refines the Euclidean topology.

Let $f\colon\mathbb R\to\mathbb R$ be a Euclidean-continuous but not uniformly continuous function, such as $f(x)=x^2$. For every $n>0$, $f_n=f\restriction[-n,n]$ can be extended to a uniformly continuous function on $\mathbb R$. By assumption, this function is continuous from $(\mathbb R,\tau_0)$ to $(\mathbb R,\tau_1)$, hence $f_n$ is continuous from $([-n,n],\tau_0)$ to $(\mathbb R,\tau_1)$. Since $\tau_0$ refines the Euclidean topology, every point has a $\tau_0$-open neighbourhood included in some $[-n,n]$, thus $f=\bigcup_nf_n$ is continuous from $(\mathbb R,\tau_0)$ to $(\mathbb R,\tau_1)$. However, it is not uniformly continuous in the Euclidean metric, a contradiction.

• A slight variant of the second part of above argument: since the $d$-topology is finer than the Euclidean, the family of intervals $I_n:=[n,n+1]$ for $n\in\mathbb{N}$ is a locally finite closed cover of $\mathbb{R}$ in the $d$-topology. Let $f$ be $x\mapsto x^2$. On each $I_n$, $f$ coincides with some uniformly continuous function, which is $d$-continuous. So $f_{|I_n}$ is also $d$-continuous, hence $f$ is $d$-continuous, hence $U$-continuous, contradiction. This way the argument works more generally for any topology on $\mathbb{R}$, even non-metric. – Pietro Majer Sep 10 '13 at 8:33
• The first part of your proof can also be done for general topologies, that is, $C((\mathbb{R},\tau),(\mathbb{R},\tau))=UC(\mathbb{R},\mathbb{R})$ implies $\tau$ is finer than the Euclidean topology. As before such $\tau$ is not the indiscrete topology and it is translation invariant. So there is a non-empty $\tau$-open set $G$ not containing $0$. Then there is also a non-empty bounded $\tau$-open set, e.g. of the form $f^{-1}(G)$ with $f$ continuous with compact support. Since $\tau$ is also homotety invariant, this implies that $\tau$ is finer than the Euclidean topology. – Pietro Majer Sep 10 '13 at 8:43
• The first part of the proof already applies to arbitrary topologies as is (that was intentional). Thanks for the second part; I was trying in vain to show that any such topology has to coincide with the Euclidean topology, I did not realize that one could construct a non-uniform continuous counterexample regardless of that. – Emil Jeřábek Sep 10 '13 at 12:12
• Excellent. (Sorry for the variant of the first part, I had the idea while far from a computer and recalled wrongly) – Pietro Majer Sep 10 '13 at 15:26

The answer is no at least in the assumptions given in parentheses.

Assume $C(\mathbb{R}, (\mathbb{R},d)) = UC(\mathbb{R},\mathbb{R})$. Since $\operatorname{id}_\mathbb{R}$ is in $UC(\mathbb{R},\mathbb{R})$ it is also in $C(\mathbb{R}, (\mathbb{R},d))$. So any $f\in C(\mathbb{R}, \mathbb{R})$ is also in $C(\mathbb{R}, (\mathbb{R},d))$ by composition. But then $C(\mathbb{R}, \mathbb{R})\subset UC(\mathbb{R},\mathbb{R})$, a contradiction.

Assume $C((\mathbb{R},d), \mathbb{R}) = UC(\mathbb{R},\mathbb{R})$. Then $\operatorname{id}_\mathbb{R}$ is in $C^0((\mathbb{R},d), \mathbb{R})$, that is the Euclidean topology is included in the $d$-topology. On the other hand, consider any convergent sequence $x_n\to x$ in the Euclidean topology. Since the function $d(x,\cdot): (\mathbb{R},d)\to \mathbb{R}$ is continuous (it is 1-Lipschitz), it is also in $UC(\mathbb{R},\mathbb{R})$, so in particular $d(x,x_n)\to d(x,x)=0$, that is $x_n\to x$ in $d$. Therefore the two topologies coincide which leads again to the contradiction $C(\mathbb{R}, \mathbb{R}) = UC(\mathbb{R},\mathbb{R})$.

$\mathbf{Proposition}$ Suppose that $d,\rho$ are metrics on $\mathbb{R}$ that induce the Euclidean topology on $\mathbb{R}$. Then there is a bounded continuous function $f:(\mathbb{R},d)\rightarrow(\mathbb{R},\rho)$ which is not uniformly continuous.

$\mathbf{Proof}$ If $n$ is a positive integer, then there is some $\epsilon_{n}$ where $0<\epsilon_{n}<1$ and where $d(n,n+\epsilon_{n})<\frac{1}{n}$. There is a continuous function $f:\mathbb{R}\rightarrow[0,1]$ with $f(n)=0$ but $f(n+\epsilon_{n})=1$ for all $n$. However, the function $f$ cannot be uniformly continuous. If $\epsilon>0$, then $\frac{1}{n}<\epsilon$ for some $n$, and $d(n,n+\epsilon_{n})<\frac{1}{n}$, but $\rho(f(n),f(n+\epsilon_{n}))=\rho(0,1)>0$.

• I didn't see that anything in the question mandated that the metric $d$ should induce the Euclidean topology. – Todd Trimble Sep 9 '13 at 17:35
• Hmm. I must have misread the question. – Joseph Van Name Sep 10 '13 at 2:34