# Continuous function that is uniformly continuous on a dense subset

Let $(X,d_X)$ and $(Y,d_Y)$ be two metric spaces, $E \subset X$ a dense set and $f:X \to Y$ be a continuous function that is uniformly continuous on E. Is $f$ then uniformly continuous on $X$? If yes, is the following proof right? If not, where is the error in my proof?

Proof: Let $\epsilon > 0$ be given. Since $f$ is uniformly continuous on $E$, there is some $\delta > 0$ such that $$\forall_{x,y \in E}\;d_X(x,y)<\delta \Rightarrow d_Y(f(x),f(y))< \frac{\epsilon}{3}$$ Now let $x,y \in X$ be arbitrary with $d_X(x,y) < \frac{\delta}{3}$. Because $f$ is continuous at $x$ and $y$ there are $\lambda_x$ and $\lambda_y$ such that $$\forall_{z \in X}\;d_X(z,x)<\lambda_x \Rightarrow d_Y(f(z),f(y)) < \frac{\epsilon}{3}$$ and $$\forall_{z \in X}\;d_X(z,y)<\lambda_x \Rightarrow d_Y(f(z),f(y)) < \frac{\epsilon}{3}$$ We set $k:= \min\{\lambda_x, \lambda_y, \delta/3\}$ and find (since $E$ is dense in $X$) $x', y' \in E$ such that $d_X(x,x') < k$ and $d_X(y,y') <k$. But then we have $$d_X(x',y') \leq d_X(x',x)+d_X(x,y)+d_X(y,y') < \frac{\delta}{3}+\frac{\delta}{3}+\frac{\delta}{3} = \delta$$ and thus $$d_Y(f(x),f(y))\leq d_Y(f(x),f(x'))+d_Y(f(x'),f(y'))+d_Y(f(y'),f(y)) < \frac{\epsilon}{3}+\frac{\epsilon}{3}+\frac{\epsilon}{3} = \epsilon$$

This proof is not correct. You proved that $d_X(x,y)<k\implies d_Y\bigl(f(x),f(y)\bigr)<\varepsilon$. However, that number $k$ doesn't depend on $\varepsilon$ alone. Since you defined it as $\min\left\{\lambda_x,\lambda_y,\frac\delta3\right\}$, it also depends on $x$ and $y$.
• This proof shows, that for any given $\varepsilon > 0$, there is some $\delta > 0$ such that for any $x,y \in X$ with $d_X(x,y)<\frac{\delta}{3}$ we have $d_Y(f(x),f(y)) < \varepsilon$. The constant $k$ is only used to show this fact and does not contradict the fact that $\delta$ is independent of $x$ and $y$. – Andrei Kh Jun 28 '18 at 12:07