TITLE: Extending a function by continuity from a dense subset of a space
QUESTION [25 upvotes]: I am given two spaces $X$ and $Y$, both Hausdorff. I have defined a uniformly continuous function on a dense set $D$ of $X$ that goes to $Y$. So once you have defined a function on a dense subset, if you would like to extend
this function to the whole set in a continuous manner, then there is at most one
way to do this. For the extension to be sequentially continuous,
all decisions are "already made" by determining the value of the function on the
dense subset. The value of $f(x)$ simply must be $\lim f(x_{n})$ where $x_{n}$ are in $D$ and converge to $x$. I proved well defined and unique. 
I am having trouble proving this is continuous, any help is appreciated.
Thanks.. And this is embarrassing, but can someone tell me how to accept an answer. Sorry...

REPLY [7 votes]: (I also assume that we work with metric spaces.)
If you only need continuity of $g$, then continuity (not uniform) of $f$ is enough*. Let a sequence $x_n \in X$  converge to some point $x$. We will show that $g(x_n)$ converges to $g(x)$. I will write '(#)' in places, where we use the definition of $g$ for better readibility.

For every $x_n$ ($n$ is fixed) there exists a sequence $(w_n^m)_{m=1}^\infty \in D$ that converges to $x_n$. Since $f(w_n^m) \ \to g(x_n)$ (#) and $w_n^m \to x_n$, we may choose such $m_n$ that $d_X(w_n^{m_n}, x_n)$ and $d_Y(f(w_n^{m_n}), g(x_n))$ are smaller then $\frac{1}{n}$. 
Now (from $d_X(w_n^{m_n}, x_n) < \frac{1}{n}$) you have: $\lim_{n \to \infty} w_n^{m_n} = x $, so (#):$\lim_{n \to \infty} f(w_n^{m_n}) = g(x) $, but we have also $d_Y(f(w_n^{m_n}),g(x_n)) < \frac{1}{n}$, so: $\lim_{n \to \infty} g(x_n) = g(x) $, which gives us the continuity of $g$.
*However you still need uniform continuity to show that $g$ is uniquely defined, so my approach is not better, it is just different.