Explicit Extensions by Linear Interpolation
The Tietze Extension Theorem guarantees that a bounded continuous real-valued function on a closed subset of a normal space extends continuously to the whole space. In concrete settings, however, it is useful to see the extension itself. On an interval, the gaps in a closed set can be filled by straight lines; on a finite subset of the real line, consecutive data values can be joined by straight lines and the ends held constant. These constructions let us check both continuity and range bounds directly.
All intervals and subsets of \(\mathbb{R}\) below have their usual subspace topologies, and \(\mathbb{R}\) has its standard topology. Recall that a function is continuous if the preimage of every open set is open. A function \(f:F\to\mathbb{R}\) is bounded by \(m\) and \(M\) if \(m\le f(x)\le M\) for every \(x\in F\).
The bounded Tietze Extension Theorem states that if \(X\) is normal, \(F\subseteq X\) is closed, and \(f:F\to\mathbb{R}\) is continuous with \(m\le f\le M\), then there is a continuous extension \(g:X\to\mathbb{R}\) with \(m\le g\le M\). We use this theorem as context, not as a substitute for the explicit constructions below. In particular, the formulas will show exactly how the extension is defined and why it preserves the bounds.
Filling the Gaps of a Closed Subset
Let \(F\) be a nonempty closed subset of a closed interval \([a,b]\), and let \(f:F\to\mathbb{R}\) be continuous with \(m\le f\le M\). The components of \([a,b]\setminus F\) are intervals. A gap with endpoints \(u,v\in F\) is filled by the affine function joining \((u,f(u))\) to \((v,f(v))\). If a gap meets \(a\) or \(b\), use the value at its one endpoint in \(F\) constantly across that gap.
Proof. On each interior gap \((u,v)\), define \(g(x)=\frac{v-x}{v-u}f(u)+\frac{x-u}{v-u}f(v)\). The two coefficients are nonnegative and sum to \(1\), so this is a convex combination of \(f(u)\) and \(f(v)\). It agrees with \(f\) at both endpoints, and it lies in \([m,M]\). On a gap meeting \(a\) or \(b\), define \(g\) to be the value at the endpoint in \(F\); this also agrees at that endpoint and lies in \([m,M]\). Set \(g=f\) on \(F\). These rules define \(g\) everywhere and give \(g|_F=f\).
It remains to check continuity. At a point in the interior of a gap, \(g\) is affine or constant on a neighborhood, so it is continuous there. Let \(x\in F\), and fix \(\varepsilon>0\). By continuity of \(f\) on \(F\), choose \(\delta>0\) such that \(p\in F\) and \(|p-x|<\delta\) imply \(|f(p)-f(x)|<\varepsilon/2\). Write \(C=\max(|m|,|M|)\). If \(C=0\), all the prescribed values and the extension are zero, so continuity holds. Otherwise choose \(r>0\) with \(r<\delta/2\) and \(8Cr/\delta<\varepsilon/2\).
Take \(y\in[a,b]\) with \(|y-x|<r\). If \(y\in F\), the choice of \(\delta\) gives \(|g(y)-g(x)|<\varepsilon/2\). If \(y\) lies in a boundary gap, its constant value is the value at the endpoint \(p\in F\) of that gap. Since \(x\in F\) is outside the gap, \(|p-x|\le |y-x|<r<\delta\), so \(|g(y)-g(x)|<\varepsilon/2\).
Now suppose \(y\) lies in an interior gap with endpoints \(p,q\in F\). The endpoint on the same side of \(y\) as \(x\) is nearest to \(x\); call it \(p\). Then \(|p-x|\le |y-x|<r\), so \(|f(p)-f(x)|<\varepsilon/2\). If \(|q-x|<\delta\), both endpoint values are within \(\varepsilon/2\) of \(f(x)\); their convex combination \(g(y)\) is also within \(\varepsilon/2\) of \(f(x)\). If \(|q-x|\ge\delta\), then \(|q-p|\ge\delta-|p-x|>\delta/2\). The coefficient of \(f(q)\) in the interpolation is \(\frac{|y-p|}{|q-p|}<\frac{2r}{\delta/2}=\frac{4r}{\delta}\), because \(|y-p|\le |y-x|+|x-p|<2r\). Since \(|f(q)-f(p)|\le 2C\), it follows that \(|g(y)-f(x)|\le |f(p)-f(x)|+\frac{4r}{\delta}\,2C<\varepsilon\). Thus \(g\) is continuous at every \(x\in F\), completing the proof. \(\square\)
Worked Example: Extending Across One Gap
Let \(F=[0,1/3]\cup[2/3,1]\subseteq[0,1]\), and define \(f(x)=x\) on \([0,1/3]\) and \(f(x)=2-2x\) on \([2/3,1]\). Extend \(f\) to \([0,1]\) by filling the gap linearly.
The left endpoint value is \(f(1/3)=1/3\), and the right endpoint value is \(f(2/3)=2-2(2/3)=2/3\). The slope across the gap is \((2/3-1/3)/(2/3-1/3)=1\). The line through \((1/3,1/3)\) with slope \(1\) is \(g(x)=x\). Therefore define \(g(x)=x\) for \(0\le x\le2/3\), and \(g(x)=2-2x\) for \(2/3\le x\le1\).
On the first part, \(g\) agrees with \(f(x)=x\) on \([0,1/3]\). On the second part, it agrees with \(f(x)=2-2x\). At the joining point, the first formula gives \(g(2/3)=2/3\), and the second gives \(g(2/3)=2-4/3=2/3\). Each piece is continuous and the values agree at the join, so the piecewise function is continuous. Its first piece has values in \([0,2/3]\); on the second, \(2-2x\) decreases from \(2/3\) to \(0\), so it too has values in \([0,2/3]\). Thus the extension preserves the original range bounds.
Finite Data on the Real Line
A finite subset \(F\subseteq\mathbb{R}\) is closed. With its subspace topology it is discrete: for each \(x\in F\), a sufficiently small open interval around \(x\) contains no other point of \(F\), so \(\{x\}\) is open in \(F\). Every function on a finite subset is therefore continuous. To extend such a function explicitly, order its points and interpolate between consecutive points.
Proof. The constant formulas on the two tails are defined everywhere on those tails. For \(x_i\le x\le x_{i+1}\), define \(g(x)=\frac{x_{i+1}-x}{x_{i+1}-x_i}f(x_i)+\frac{x-x_i}{x_{i+1}-x_i}f(x_{i+1})\). The denominator is positive because \(x_i<x_{i+1}\). The coefficients are nonnegative and sum to \(1\); at \(x_i\) the formula gives \(f(x_i)\), and at \(x_{i+1}\) it gives \(f(x_{i+1})\). Thus adjacent formulas agree at each node, and \(g\) extends \(f\). Each interpolated value is a convex combination of two values in \([m,M]\), so it remains in \([m,M]\); the constant tails also do. On each interval and tail the formula is continuous, and the formulas agree at their shared endpoints. Hence \(g\) is continuous on \(\mathbb{R}\). \(\square\)
If \(F=\varnothing\), there are no values to match: any constant function \(g:\mathbb{R}\to[m,M]\) is a continuous extension of the empty function. If \(F\) has one point, the theorem's formula simply gives the constant extension with that value, provided the chosen bounds include it.
Worked Example: Three Prescribed Values
Extend the function on \(F=\{-2,0,3\}\) given by \(f(-2)=4\), \(f(0)=-2\), and \(f(3)=1\), preserving the bounds \([-2,4]\).
On \((-\infty,-2]\), set \(g(x)=4\). Between \(-2\) and \(0\), the slope is \((-2-4)/(0-(-2))=-6/2=-3\). The line through \((-2,4)\) is \(4-3(x+2)=-3x-2\). Between \(0\) and \(3\), the slope is \((1-(-2))/(3-0)=3/3=1\), so the line through \((0,-2)\) is \(x-2\). On \([3,\infty)\), set \(g(x)=1\). Altogether, \(g(x)=4\) for \(x\le-2\), \(g(x)=-3x-2\) for \(-2\le x\le0\), \(g(x)=x-2\) for \(0\le x\le3\), and \(g(x)=1\) for \(x\ge3\).
At \(-2\), the constant formula gives \(4\), and the linear formula gives \(-3(-2)-2=4\). At \(0\), the two linear formulas give \(-2\) and \(-2\). At \(3\), the linear formula gives \(3-2=1\), matching the tail. These agreements prove continuity at the join points; each formula is continuous elsewhere. On \([-2,0]\), \(-3x-2\) decreases from \(4\) to \(-2\); on \([0,3]\), \(x-2\) increases from \(-2\) to \(1\). Together with the tails, this verifies \(-2\le g(x)\le4\) everywhere and checks all three prescribed values.
A Range-Bound Pitfall
Polynomial interpolation can match finite data without producing a range-preserving extension. For example, on \(F=\{0,1\}\), prescribe \(f(0)=0\) and \(f(1)=1\). The polynomial \(p(x)=x\) matches both values, but \(p(2)=2\), outside the original range \([0,1]\). It also has no bounded range on \(\mathbb{R}\). The constant-tail, linear interpolation construction instead gives \(g(x)=0\) for \(x\le0\), \(g(x)=x\) for \(0\le x\le1\), and \(g(x)=1\) for \(x\ge1\). It matches the data and satisfies \(0\le g(x)\le1\) for every real \(x\). The mistake is to treat agreement on the finite set as sufficient: a bounded Tietze extension must also meet the requested global range bound.
These constructions are useful when the set and data are explicit: the formula makes the extension checkable without an existence argument alone. For a closed subset of an interval, linear interpolation on each complementary gap preserves bounds because every interpolated value lies between the endpoint values. For finite data on the real line, constant tails also prevent uncontrolled growth beyond the outermost prescribed points.
Check Your Understanding
For each question, identify the prescribed set and verify both agreement and the claimed range.
- Extend \(f(x)=x^2\) from \(F=\{0,1\}\subseteq[0,1]\) by linear interpolation, and state its range.
- For \(F=\{-1,2\}\subseteq\mathbb{R}\), with values \(f(-1)=3\) and \(f(2)=-1\), write the constant-tail, linear extension.
- Why does linear interpolation between two values in \([m,M]\) remain in \([m,M]\)?
- What constant extension is available for a function on the empty subset when the required bounds satisfy \(m\le M\)?
- Give a polynomial matching values \(0\) at \(0\) and \(1\) at \(1\) that fails to preserve the range \([0,1]\) on \(\mathbb{R}\).