In the light of Alex Youcis's comment, I will assume that $X$ and $Y$ are metric spaces. The following approach has been taken verbatim (apart from notation changes) from John Erdman, A ProblemText in Advanced Calculus (Chapter 24, pp. 146-147).
If $f : X \to Y$ is a uniformly continuous map between two metric
spaces and $(x_n)$ is a Cauchy sequence in $X$, then $f(x_n)$ is a Cauchy sequence in $Y$.
Let $X$ and $Y$ be metric spaces, $S \subseteq X$, and $f : S \to Y$ be uniformly continuous. If two sequences $(x_n)$ and $(y_n)$ in $S$ converge to the same limit in $X$ and if the sequence $f(x_n)$ converges, then the sequence $f(y_n)$ converges and $\lim f(x_n) = \lim f(y_n)$.
Proof Hint. Consider the "interlaced" sequence $(x_1, y_1, x_2, y_2, x_3, y_3, \ldots)$.
Now, the main theorem.
Theorem. Let $X$ and $Y$ be metric spaces, $S$ a subset of $X$, and $f : S \to Y$. If $f$ is uniformly continuous and $Y$ is complete, then there exists a unique continuous extension of $f$ to $\overline S$. Furthermore, this extension is uniformly continuous.
Proof Hint. Deﬁne $g : \overline S \to Y$ by $g(a) = \lim f(x_n)$ where $(x_n)$ is a sequence in $S$ converging to $a$. First show that $g$ is well deﬁned. To this end you must show that
- $\lim f(x_n)$ does exist, and
- the value assigned to $g$ at $a$ does not depend on the particular sequence $(x_n)$ chosen. That is, if $x_n \to a$ and $y_n \to a$, then $\lim f(x_n) = \lim f(y_n)$.
Next show that $g$ is an extension of $f$.
To establish the uniform continuity of $g$, let $a$ and $b$ be points in $\overline S$. If $(x_n)$ is a sequence in $S$ converging to $a$, then $f(x_n) \to g(a)$. This implies that both $d(x_j , a)$ and $d (f(x_j ), g(a))$ can be made as small as we please by choosing $j$ sufficiently large. A similar remark holds for a sequence $(y_n)$ in $S$ which converges to $b$. From this show that $x_j$ is arbitrarily close to $y_k$ (for large $j$ and $k$) provided we assume that $a$ is sufficiently close to $b$. Use this in turn to show that $g(a)$ is arbitrarily close to $g(b)$ when $a$ and $b$ are sufficiently close.
The uniqueness argument is very easy.