Extension of continuous functions on closed set

analysiscalculusreal-analysis

Let $F\subset\mathbb{R}$ be a closed set, and $f:F\to\mathbb{R}$ is a continuous function. Show that there is a function $g$ defined and continuous on $(-\infty,\infty)$ such that $f(x)=g(x)$ for each $x\in F$.

The hint is telling that since $F^c$ is open, it's composed of a countable collection of disjoint open intervals, noted as $\bigcup_k (a_k,b_k)$. Then take $g$ to be linear in each of the intervals.

But I'm stuck when I'm try to prove $g$ is continuous considering the fact that a function separately continues on two sets may not continues on their unions. And I don't know how to apply the definition when every intervals like $(a_k-\delta,a_k)$ may contain points both in $F$ and $F^c$. So how should I deal with this problem?

Best Answer

If $x_0 \in F^c$ then $g$ is linear in a neighborhood of $x_0$ and therefore continuous at $x_0$.

The more interesting case is to prove continuity at a point $x_0 \in F$: Given $\epsilon > 0$ there is a $\delta > 0$ such that $|f(x)-f(x_0)| < \epsilon$ for all $x \in F$ with $|x-x_0 |< \delta$. Now we consider two cases:

Case 1: The open interval $(x_0, x_0 + \epsilon)$ does not contain any point from the set $F$. In that case is $g$ linear on $(x_0, x_0 + \epsilon)$ with $\lim_{x \to x_0} g(x) = f(x_0) = g(x_0)$.

Case 2: There is a $ x_1 \in (x_0, x_0 + \epsilon) \cap F$. For every $x \in (x_0, x_1)$ is $g(x) $ either equal to $f(x)$, or a value between $f(a)$ and $f(b)$ with $x_0 \le a < x < b \le x_1$. In both cases is $|g(x) - f(x_0)| < \epsilon$.

This shows that $g$ is right-continuous at $x_0$. In the same way one can show that $g$ is left-continuous at $x_0$.