Suppose that $f : (0, 2] \to \mathbb{R}$ is a continuous function and that $\lim_{x \to 0}f(x) = L$ for some $L \in \mathbb{R}$. Define $g : [0, 2] \to \mathbb{R}$ via $g(0)=L$ and $g(x)= f(x)$ for $x \in (0,2]$.
(i) Show that $g$ is continuous on $[0, 2]$.
(ii) Show that $f$ is uniformly continuous on $(0, 2]$.
I'm struggling to know where to start! I understand that $|g(y)-g(x)|< \varepsilon$ for all $y \in [0,2]$ with $|y-x|<\delta$.
I just can't get the formal proof started.
Since $g(x)= f(x)$ on $(0, 1]$, and $f$ is continuous on $(0, 1]$, $g$ is continuous on $(0, 1]$. It is only necessary to show that $g$ is right-continuous at $0$. That is, that $\lim_{x\to 0^+} g(x)= L$ which is true because we were also told that $\lim_{x\to 0+} f(x)= L= g(0)$.
Saying that $f$ is "continuous" on $(0, 1]$ means "for every $x_0\in (0,1]$, given $\epsilon> 0$ there exist $\delta> 0$ such that if $|x- x_0|< \delta$ then $|f(x)- f(x_0)|<\epsilon$". Saying that $f$ is "uniformly continuous" means that, given $\epsilon$, we can choose a value of $\delta$ that will work for any $x_0$. There is a theorem that says that "if a function is continuous on a compact (i.e. closed and bounded) interval then it is uniformly continuous on that interval". So here you can choose some small $x_0$, assert that $f$ is uniformly continuous on $[x_0, 1]$, and then show that, given $\epsilon> 0$ there exist some smallest $\delta$ that will also work for $x\in (0, x_0)$.