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 ? 



Continuous functions as uniformly continuous function
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.


