Show that a uniformly continuous function on $E$ has a unique continuous extension to $cl(E)$ 
Suppose X is a metric space and $f : E ⊂ X → R$ is a uniformly continuous function on a set E. Denote cl(E) to be the closure of E in X. Prove that there is a unique continuous function $g : cl(E) → R$ such that $g(x) = f(x), ∀x ∈ E$.

I'm not sure where to start on this one... I know that E is dense in cl(E), then any point x of E is the limit point of a sequence {${x_n}$} in cl(E), but I am not too sure how to continue from this.
 A: You are on the right track: define $g : \overline{E} \to \Bbb{R}$ as $$g(x) := \lim_{n\to\infty} f(x_n)$$
where $(x_n)_n$ is a sequence in $E$ which converges to $x$. We have to show that $g$ is well-defined, continuous, and that $g|_E = f$.

*

*It is easy to show that uniformly continuous functions map Cauchy sequences to Cauchy sequences. Since $x_n \to x$, in particular $(x_n)_n$ is Cauchy in $X$ so $(f(x_n))_n$ is Cauchy in $\Bbb{R}$ and hence converges.
Assume $y_n \to x$ as well. Then the sequence
$$x_1, y_1, x_2, y_2, \ldots$$
also converges to $x$. By the above discussion, the sequence
$$f(x_1), f(y_1), f(x_2), f(y_2), \ldots$$
converges in $\Bbb{R}$ so in particular $\lim_{n\to\infty} f(x_n) = \lim_{n\to\infty} f(y_n)$.


*For every $x \in E$ the constant sequence $(x)_n$ tends to $x$ so $g(x) = f(x)$.


*Let $x \in \overline{E}$ and $\varepsilon > 0$. $f$ is uniformly continuous so there exists $\delta_1 > 0$ such that
$$d(a,b) < \delta_1 \implies |f(a) - f(b)| < \frac\varepsilon3.$$
Let $\delta := \frac{\delta_1}3$ and let $y \in \overline{E}$ such that $d(x,y) < \delta$. Pick sequences $(x_n)_n$ and $(y_n)_n$ in $E$ such that $x_n \to x$ and $y_n \to y$. By definition of $g$ we have $f(x_n) \to g(x)$ and $f(y_n) \to g(y)$ so pick $n \in \Bbb{N}$ large enough so that $$d(x_n,x) < \frac\varepsilon3, \quad d(x_n,x) < \frac\varepsilon3, \quad |f(x_n)-g(x)| < \frac\varepsilon3, \quad |f(y_n)-g(y)| < \frac\varepsilon3$$
Hence we have
$$d(x_n,y_n) \le d(x_n,x) + d(x,y) + d(y,y_n) < 3\delta = \delta_1 \implies |f(x_n)-f(y_n)| < \frac\varepsilon3$$
so
$$|g(x)-g(y)| \le |g(x)-f(x_n)| + |f(x_n)-f(y_n)| + |f(y_n)-g(y)| < \varepsilon.$$
