[proofplan]
We construct $\widehat X$ as the set of Cauchy sequences in $X$ modulo the [equivalence relation](/page/Equivalence%20Relation) of having mutual distance tending to $0$. The metric on $\widehat X$ is defined by taking the limit of pairwise distances, and the Cauchy property guarantees that this limit exists and is independent of representatives. The constant-sequence map embeds $X$ isometrically and has dense image; completeness follows by approximating a [Cauchy sequence](/page/Cauchy%20Sequence) in $\widehat X$ by points coming from $X$. Finally, a uniformly continuous map into a complete space extends by sending a Cauchy-sequence class to the corresponding limit in $Y$, and density gives uniqueness.
[/proofplan]
[step:Construct the completion from Cauchy sequences]
Let $\mathcal C(X)$ denote the set of all Cauchy sequences in $X$. Define a relation $\sim$ on $\mathcal C(X)$ by declaring that two Cauchy sequences $(x_n)_{n=1}^\infty$ and $(y_n)_{n=1}^\infty$ satisfy $(x_n)\sim (y_n)$ if
\begin{align*}
\lim_{n\to\infty} d_X(x_n,y_n)=0.
\end{align*}
This is an equivalence relation. Reflexivity follows from $d_X(x_n,x_n)=0$. Symmetry follows from symmetry of $d_X$. For transitivity, if $(x_n)\sim(y_n)$ and $(y_n)\sim(z_n)$, then the triangle inequality gives
\begin{align*}
d_X(x_n,z_n)\le d_X(x_n,y_n)+d_X(y_n,z_n),
\end{align*}
so $d_X(x_n,z_n)\to 0$.
Define
\begin{align*}
\widehat X:=\mathcal C(X)/{\sim}.
\end{align*}
For a Cauchy sequence $(x_n)_{n=1}^\infty$, write $[(x_n)]$ for its equivalence class.
For $\xi=[(x_n)]\in \widehat X$ and $\eta=[(y_n)]\in \widehat X$, define
\begin{align*}
\widehat d(\xi,\eta):=\lim_{n\to\infty} d_X(x_n,y_n).
\end{align*}
This limit exists because, for $m,n\in\mathbb N$, the [reverse triangle inequality](/theorems/2300) gives
\begin{align*}
\left|d_X(x_n,y_n)-d_X(x_m,y_m)\right|
\le d_X(x_n,x_m)+d_X(y_n,y_m),
\end{align*}
and the right-hand side tends to $0$ as $m,n\to\infty$. Hence $(d_X(x_n,y_n))_{n=1}^\infty$ is a Cauchy sequence in $\mathbb R$ and therefore converges.
The value of $\widehat d(\xi,\eta)$ is independent of the representatives. Indeed, if $(x_n)\sim(x_n')$ and $(y_n)\sim(y_n')$, then
\begin{align*}
\left|d_X(x_n,y_n)-d_X(x_n',y_n')\right|
\le d_X(x_n,x_n')+d_X(y_n,y_n'),
\end{align*}
and the right-hand side tends to $0$.
The function $\widehat d:\widehat X\times \widehat X\to [0,\infty)$ is a metric. Non-negativity and symmetry follow from the corresponding properties of $d_X$. Also,
\begin{align*}
\widehat d([(x_n)],[(y_n)])=0
\end{align*}
holds if and only if $(x_n)\sim(y_n)$, which is exactly equality of equivalence classes. Finally, for $\xi=[(x_n)]$, $\eta=[(y_n)]$, and $\zeta=[(z_n)]$, the triangle inequality in $X$ gives
\begin{align*}
d_X(x_n,z_n)\le d_X(x_n,y_n)+d_X(y_n,z_n).
\end{align*}
Taking limits gives
\begin{align*}
\widehat d(\xi,\zeta)\le \widehat d(\xi,\eta)+\widehat d(\eta,\zeta).
\end{align*}
[/step]
[step:Embed $X$ isometrically with dense image]
Define the map
\begin{align*}
i:X&\to \widehat X\\
x&\mapsto [(x,x,x,\dots)].
\end{align*}
For $x,y\in X$, the defining formula for $\widehat d$ gives
\begin{align*}
\widehat d(i(x),i(y))=\lim_{n\to\infty} d_X(x,y)=d_X(x,y).
\end{align*}
Thus $i$ is an isometric embedding.
We prove that $i(X)$ is dense in $\widehat X$. Let $\xi=[(x_n)]\in\widehat X$. For each $n\in\mathbb N$, the point $i(x_n)\in i(X)$ satisfies
\begin{align*}
\widehat d(i(x_n),\xi)
=\lim_{m\to\infty} d_X(x_n,x_m).
\end{align*}
Since $(x_n)$ is Cauchy, the right-hand side tends to $0$ as $n\to\infty$. Hence $i(x_n)\to \xi$ in $\widehat X$, so every point of $\widehat X$ lies in the closure of $i(X)$.
[/step]
[step:Prove that $\widehat X$ is complete]
Let $(\xi_k)_{k=1}^\infty$ be a Cauchy sequence in $\widehat X$. Since $i(X)$ is dense in $\widehat X$, for each $k\in\mathbb N$ choose $z_k\in X$ such that
\begin{align*}
\widehat d(i(z_k),\xi_k)<\frac{1}{k}.
\end{align*}
We claim that $(z_k)_{k=1}^\infty$ is a Cauchy sequence in $X$. Let $\varepsilon>0$. Choose $N\in\mathbb N$ such that $1/N<\varepsilon/3$ and
\begin{align*}
\widehat d(\xi_k,\xi_l)<\frac{\varepsilon}{3}
\end{align*}
whenever $k,l\ge N$. Then for $k,l\ge N$,
\begin{align*}
d_X(z_k,z_l)
&=\widehat d(i(z_k),i(z_l))\\
&\le \widehat d(i(z_k),\xi_k)+\widehat d(\xi_k,\xi_l)+\widehat d(\xi_l,i(z_l))\\
&<\frac{1}{k}+\frac{\varepsilon}{3}+\frac{1}{l}\\
&<\varepsilon.
\end{align*}
Thus $(z_k)$ is Cauchy in $X$.
Let
\begin{align*}
\xi:=[(z_k)]\in\widehat X.
\end{align*}
We show that $\xi_k\to \xi$ in $\widehat X$. For $k\in\mathbb N$,
\begin{align*}
\widehat d(\xi_k,\xi)
\le \widehat d(\xi_k,i(z_k))+\widehat d(i(z_k),\xi).
\end{align*}
The first term is less than $1/k$. For the second term,
\begin{align*}
\widehat d(i(z_k),\xi)=\lim_{l\to\infty} d_X(z_k,z_l),
\end{align*}
which tends to $0$ as $k\to\infty$ because $(z_k)$ is Cauchy. Therefore $\widehat d(\xi_k,\xi)\to 0$, so every Cauchy sequence in $\widehat X$ converges. Hence $(\widehat X,\widehat d)$ is complete.
[/step]
[step:Define the extension by taking limits along representatives]
Let $(Y,d_Y)$ be a [complete metric space](/page/Complete%20Metric%20Space), and let $f:X\to Y$ satisfy the hypothesis in the statement. Define
\begin{align*}
\widehat f:\widehat X&\to Y\\
[(x_n)]&\mapsto \lim_{n\to\infty} f(x_n).
\end{align*}
This is well-defined. Indeed, if $(x_n)$ is Cauchy in $X$, the hypothesis applied to $(x_n)$ and itself implies that $(f(x_n))$ converges in $Y$. If $(x_n)\sim(y_n)$, the same hypothesis implies that $(f(x_n))$ and $(f(y_n))$ converge to the same limit. Hence the value of $\widehat f([(x_n)])$ depends only on the equivalence class.
For $x\in X$, the constant sequence $(x,x,x,\dots)$ represents $i(x)$, so
\begin{align*}
\widehat f(i(x))
=\lim_{n\to\infty} f(x)
=f(x).
\end{align*}
Thus $\widehat f\circ i=f$.
[/step]
[step:Show that the extension is continuous by using uniform continuity]
We prove that $\widehat f$ is continuous. Let $\xi\in\widehat X$, and let $(\xi_k)_{k=1}^\infty$ be a sequence in $\widehat X$ such that $\xi_k\to\xi$. Choose a Cauchy sequence $(x_n)_{n=1}^\infty$ in $X$ representing $\xi$. For each $k\in\mathbb N$, choose a Cauchy sequence $(x_{k,n})_{n=1}^\infty$ in $X$ representing $\xi_k$.
Let $\varepsilon>0$. Since $f:X\to Y$ is uniformly continuous, there exists $\delta>0$ such that for all $a,b\in X$,
\begin{align*}
d_X(a,b)<\delta \implies d_Y(f(a),f(b))<\varepsilon.
\end{align*}
Since $\xi_k\to\xi$ in $\widehat X$, there exists $K\in\mathbb N$ such that
\begin{align*}
\widehat d(\xi_k,\xi)<\frac{\delta}{2}
\end{align*}
for all $k\ge K$. Fix $k\ge K$. By the definition of $\widehat d$,
\begin{align*}
\lim_{n\to\infty} d_X(x_{k,n},x_n)=\widehat d(\xi_k,\xi)<\frac{\delta}{2}.
\end{align*}
Hence there exists $N_k\in\mathbb N$ such that
\begin{align*}
d_X(x_{k,n},x_n)<\delta
\end{align*}
for all $n\ge N_k$. [Uniform continuity](/page/Uniform%20Continuity) then gives
\begin{align*}
d_Y(f(x_{k,n}),f(x_n))<\varepsilon
\end{align*}
for all $n\ge N_k$.
By definition of $\widehat f$, the sequences $(f(x_{k,n}))_{n=1}^\infty$ and $(f(x_n))_{n=1}^\infty$ converge in $Y$ to $\widehat f(\xi_k)$ and $\widehat f(\xi)$, respectively. Taking the limit as $n\to\infty$ in the preceding inequality and using continuity of the metric $d_Y:Y\times Y\to[0,\infty)$ gives
\begin{align*}
d_Y(\widehat f(\xi_k),\widehat f(\xi))\le \varepsilon
\end{align*}
for all $k\ge K$. Since $\varepsilon>0$ was arbitrary, $\widehat f(\xi_k)\to\widehat f(\xi)$ in $Y$.
Thus $\widehat f$ is sequentially continuous. Since metric spaces are first-countable, sequential continuity is equivalent to continuity, so $\widehat f$ is continuous.
[/step]
[step:Use density to prove uniqueness]
Let $g:\widehat X\to Y$ be a continuous map satisfying $g\circ i=f$. We prove that $g=\widehat f$.
Let $\xi=[(x_n)]\in\widehat X$. From the density argument above, $i(x_n)\to \xi$ in $\widehat X$. Since $g$ is continuous,
\begin{align*}
g(\xi)=\lim_{n\to\infty} g(i(x_n)).
\end{align*}
Because $g\circ i=f$, this becomes
\begin{align*}
g(\xi)=\lim_{n\to\infty} f(x_n)=\widehat f(\xi).
\end{align*}
Since $\xi\in\widehat X$ was arbitrary, $g=\widehat f$. Therefore the continuous extension is unique.
[/step]
[step:Derive the stated particular case]
Assume now that $f:X\to Y$ is uniformly continuous and sends Cauchy sequences in $X$ to Cauchy sequences in $Y$. Since $Y$ is complete, every sequence $(f(x_n))$ obtained from a Cauchy sequence $(x_n)$ in $X$ converges in $Y$.
It remains to check that Cauchy-equivalent sequences have the same limit. Let $(x_n)$ and $(y_n)$ be Cauchy sequences in $X$ with $d_X(x_n,y_n)\to 0$. Let $\varepsilon>0$. By uniform continuity of $f$, there exists $\delta>0$ such that for all $a,b\in X$,
\begin{align*}
d_X(a,b)<\delta \implies d_Y(f(a),f(b))<\varepsilon.
\end{align*}
Since $d_X(x_n,y_n)\to 0$, there exists $N\in\mathbb N$ such that $d_X(x_n,y_n)<\delta$ for all $n\ge N$. Hence
\begin{align*}
d_Y(f(x_n),f(y_n))<\varepsilon
\end{align*}
for all $n\ge N$, so $d_Y(f(x_n),f(y_n))\to 0$. Therefore the two convergent sequences $(f(x_n))$ and $(f(y_n))$ have the same limit. The universal property just proved applies, and the extension $\widehat f:\widehat X\to Y$ exists and is unique.
[/step]