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$$