# Extending a function to obtain continuity

I am working on a two part problem for studying. Not homework. Not exam prep.

The problem is

Let $f\colon(0,1]\rightarrow\mathbb{R}$ be a uniformly continuous function on $(0,1].$
a. State the definition of uniform continuity and use it to show that $g(x)=\ln x$ is not uniformly continuous on $(0,1]$,

b. Prove that $f$ can be extended uniquely to a continuous function on $[0,1]$.

I know how to do part a but don't know how to prove the extenstion portion in part b.

Take any sequence $\{x_n\}$ convergint to $0$. It is of course Cauchy sequence. Using uniform continuity show that $\{f(x_n)\}$ is also Cauchy sequence in $\mathbb{R}$. Hence it have a limit. Since $\{x_n\}$ is arbitrary $f$ have a limit at $0$. The rest is clear.
In fact the more general result holds. Let $X$ and $Y$ be a metric spaces and $Y$ is complete, then every uniformly continuous function $f:X\to Y$ have unique extension onto the completion of $X$ and moreover this extension is also uniformly continuous.
Let $(x_n) \in (0,1]^{\mathbb N}$ be such that $x_n \to 0$. We will prove that $(f(x_n))$ converges, as $\mathbb R$ is complete, it suffices to prove that $(f(x_n))$ is Cauchy. Let $\epsilon > 0$, by uniform continuity, there is an $\delta > 0$ such that $|x-y| < \delta$ implies $|f(x)-f(y)|< \epsilon$. As $x_n \to 0$, $(x_n)$ is Cauchy, hence there is an $N$ such that $|x_n - x_m| < \delta$ for $n,m \ge N$. So $|f(x_n) - f(x_m)| <\epsilon$ for $n,m \ge N$.
As for every sequence $x_n \to 0$, $\lim_{n\to\infty} f(x_n)$ exists, the value of the limit does not depend on $(x_n)$. So $\lim_{x\to 0^+} f(x)$ exists, and $$\bar f(x) = \begin{cases} f(x) & x > 0\\ \lim_{x\to 0^+} f(x) \end{cases}$$ is the unique continuous extension of $f$.