= Solution
For each $x\in X$, <dense subset>[density] of $Y$ allows a sequence $y_n\in Y$ with $d(y_n,x)<1/n$. If $f_1,f_2$ are two continuous extensions, <continuity> gives
$$
f_1(x)=\lim_n g(y_n)=f_2(x).
$$
Thus \b[a continuous extension is unique if it exists].
Now assume $g$ is <uniformly continuous>. Each chosen $y_n\to x$ is a <Cauchy sequence>, so part (a), applied to $Y$, shows that $g(y_n)$ converges in $\mathbb R$. Define
$$
\boxed{f(x)=\lim_{n\to\infty}g(y_n).}
$$
This is independent of the choice: for another $z_n\to x$ in $Y$, $d(y_n,z_n)\to0$, and uniform continuity gives $g(y_n)-g(z_n)\to0$. At $x\in Y$, comparison with the constant sequence $x$ proves $f(x)=g(x)$.
To prove uniform continuity of the extension, choose $\delta>0$ so that $|g(y)-g(z)|<\varepsilon/2$ whenever $y,z\in Y$ and $d(y,z)<\delta$. If $d(x,x')<\delta/3$, choose sequences $y_n\to x$ and $z_n\to x'$ in $Y$. For large $n$, both approximation distances are less than $\delta/3$, so $d(y_n,z_n)<\delta$. Passing to the limit gives $|f(x)-f(x')|\leq\varepsilon/2<\varepsilon$. The same $\delta/3$ works for all $x,x'$. Therefore \b[the extension exists and is uniformly continuous]. No completeness of $X$ is needed; completeness of the target $\mathbb R$ is the relevant requirement.
Back to article page