Why Continuous Ranges Have No Gaps
A continuous function can change the size and shape of its domain’s image, but when its domain is an interval in the real line, its range cannot have a gap. The key is that the image remains connected, and a connected subset of the real line is an interval. Once this is established, a range can often be found by proving upper and lower bounds and checking whether those bounds are attained.
Throughout, \(\mathbb{R}\) has its standard topology, and an interval \(I\subseteq\mathbb{R}\) has the subspace topology. A map \(f:I\to\mathbb{R}\) is continuous with respect to these topologies. Its range is the subset \(f(I)=\{f(x):x\in I\}\) of \(\mathbb{R}\), with the subspace topology.
Earlier results on connectedness establish that every interval in \(\mathbb{R}\) is connected, and that every connected subset of \(\mathbb{R}\) is an interval. The next argument applies these facts to continuous maps, while spelling out why continuity preserves connectedness.
The Range Theorem
Proof. If \(I=\varnothing\), then \(f(I)=\varnothing\), which is an interval. Otherwise \(I\) is connected, by the result that every real interval is connected. Suppose \(f(I)\) were disconnected. Then there would be disjoint, nonempty sets \(A,B\), open in \(f(I)\), with \(f(I)=A\cup B\). Continuity implies that \(f^{-1}(A)\) and \(f^{-1}(B)\) are open in \(I\). They are disjoint, their union is \(I\), and both are nonempty because \(A\) and \(B\) contain points of \(f(I)\). This contradicts the connectedness of \(I\). Thus \(f(I)\) is connected. The result that connected subsets of \(\mathbb{R}\) are intervals now gives that \(f(I)\) is an interval. The final statement follows from the definition of interval, applied to \(f(u)\) and \(f(v)\). \(\square\)
This theorem determines the shape of the range, not its endpoints. An interval may be open, closed, half-open, unbounded, or a singleton. To determine a particular range, combine the theorem with direct information about the values of \(f\).
Proof. Suppose \(m<y<M\). Since \(m\) is the infimum, \(y\) cannot be a lower bound for \(S\); therefore some \(s_1\in S\) satisfies \(s_1<y\). Since \(M\) is the supremum, \(y\) cannot be an upper bound for \(S\); therefore some \(s_2\in S\) satisfies \(y<s_2\). As \(S\) is an interval and \(s_1<y<s_2\), we have \(y\in S\). By definition, \(m\) is an endpoint of \(S\); it belongs to \(S\) precisely if there is an element of \(S\) equal to \(m\), which is precisely attainment of the infimum. The same reasoning applies to \(M\). Finally, if \(m=M\), every \(s\in S\) satisfies \(m\le s\le M=m\), so \(s=m\). Nonemptiness then gives \(S=\{m\}\). \(\square\)
Thus, when a continuous function on an interval has a bounded range, it is enough to identify the infimum and supremum and decide whether each is achieved. Calculus can help locate candidate extrema, but a range argument must still check the domain and endpoint conditions.
Polynomial Ranges
Worked Example: A Quadratic on a Closed Interval
Find the range of \(f(x)=x^2-2x\) on \(I=[-1,2]\). This is a polynomial, hence continuous, and \(I\) is an interval, so the range is an interval.
Complete the square: $$ f(x)=x^2-2x=(x-1)^2-1. $$ For \(x\in[-1,2]\), we have \(-2\le x-1\le1\), so \(0\le(x-1)^2\le4\). Consequently \(-1\le f(x)\le3\). The lower bound is attained at \(x=1\), since \(f(1)=1-2=-1\). The upper bound is attained at \(x=-1\), since \(f(-1)=(-1)^2-2(-1)=1+2=3\). The range theorem ensures that every value between these attained values occurs.
Conclusion: \(f([-1,2])=[-1,3]\).
Check: The formula gives \(f(1)=(1-1)^2-1=-1\) and \(f(-1)=(-1-1)^2-1=4-1=3\), matching the claimed endpoints. The bound \(-1\le f(x)\le3\) excludes values outside the proposed range.
Worked Example: A Cubic with an Excluded Domain Endpoint
Find the range of \(p(x)=x^3-3x\) on \(I=(-2,2]\). The domain is an interval and the polynomial is continuous, so its range is an interval.
For every \(x\in(-2,2]\), the following factorizations give bounds: $$ p(x)-2=x^3-3x-2=(x-2)(x+1)^2\le0, $$ because \(x-2\le0\) and \((x+1)^2\ge0\). Also, $$ p(x)+2=x^3-3x+2=(x+2)(x-1)^2\ge0, $$ because \(x+2>0\) on this domain and \((x-1)^2\ge0\). Hence \(-2\le p(x)\le2\).
Both bounds are attained at points in the domain: \(p(-1)=(-1)^3-3(-1)=-1+3=2\), and \(p(1)=1^3-3(1)=1-3=-2\). Since the range is an interval containing both \(-2\) and \(2\), it contains every value between them.
Conclusion: \(p((-2,2])=[-2,2]\). Although the domain excludes \(-2\), the range still contains its lower endpoint because \(p(1)=-2\).
Check: Substituting \(x=-1\) into the first factorization gives \(p(-1)-2=(-3)(0)^2=0\), so \(p(-1)=2\). Substituting \(x=1\) into the second gives \(p(1)+2=(3)(0)^2=0\), so \(p(1)=-2\). These agree with the direct evaluations.
Worked Example: A Polynomial with Unattained Range Endpoints
Find the range of \(g(x)=x^2\) on \(I=(-1,2)\). For every \(x\in(-1,2)\), \(x^2\ge0\). If \(-1<x<0\), then \(|x|<1\), so \(x^2<1\). If \(0\le x<2\), then \(x^2<4\). Thus \(0\le g(x)<4\).
The lower bound is attained because \(0\in(-1,2)\) and \(g(0)=0\). The value \(4\) is not attained: \(x^2=4\) requires \(x=-2\) or \(x=2\), neither of which belongs to the domain. To verify that no values between the bounds are missing, take any \(y\) with \(0\le y<4\). Its nonnegative square root \(x=\sqrt{y}\) satisfies \(0\le x<2\), so \(x\in(-1,2)\) and \(g(x)=x^2=y\).
Conclusion: \(g((-1,2))=[0,4)\).
Check: The chosen input \(x=\sqrt{y}\) gives \(g(x)=(\sqrt{y})^2=y\) for each \(y\in[0,4)\). The strict upper bound follows from \(x<2\) for nonnegative \(x\), together with \(x^2<1\) for negative \(x\) in this domain.
A Trigonometric Range
Worked Example: Sine over a Full Period
Find the range of \(f(x)=\sin x\) on \(I=[0,2\pi]\). Sine is continuous, so its range on this interval is an interval. The identity \(\sin^2x+\cos^2x=1\) implies \(\sin^2x\le1\), hence \(-1\le\sin x\le1\).
The endpoints of these bounds are both attained within the domain: $$ \sin\left(\frac{\pi}{2}\right)=1,\qquad \sin\left(\frac{3\pi}{2}\right)=-1. $$ The range is an interval containing both \(-1\) and \(1\), and the bound shows that it contains no values outside those endpoints.
Conclusion: \(\sin([0,2\pi])=[-1,1]\).
Check: At \(x=\pi/2\), \(\sin^2x+\cos^2x=1^2+0^2=1\); at \(x=3\pi/2\), the calculation is \((-1)^2+0^2=1\). The exact sine values attain the claimed maximum and minimum, and the identity bounds every other value.
What the Domain Does—and Does Not—Tell You
The range theorem says that continuous images of intervals have no gaps. It does not say that the range has the same endpoint pattern as the domain. The quadratic examples show that an excluded domain endpoint can correspond to an attained range endpoint, or that a range endpoint can be excluded even when the function has a simple formula. What matters is whether the extreme range values are actually attained by inputs in the domain.
Common pitfall. A domain interval is not itself the range. For example, the incorrect calculation \(\sin([0,2\pi])=[0,2\pi]\) merely repeats the domain and ignores the function values. The bound \(-1\le\sin x\le1\) rules out that answer, and the inputs \(\pi/2\) and \(3\pi/2\) show that both bounds occur. The correct range is \([-1,1]\). Connectedness supplies the values between the extremes; it does not identify the extremes or determine whether they are attained.
For a new example, a reliable procedure is to verify continuity and that the domain is an interval, establish bounds on the function values, test whether the bounds are attained at inputs in the domain, and then use the range theorem to conclude that every intermediate value occurs.
Check Your Understanding
For each question, distinguish the values that are bounded from those that are actually attained.
- Find the range of \(f(x)=x^2+1\) on \([-2,1]\). Identify inputs attaining its minimum and maximum.
- Find the range of \(h(x)=x^3\) on \((-1,1)\). Which bounds are not attained?
- Explain why a continuous function from an interval into \(\mathbb{R}\) cannot have a range consisting of exactly two distinct values.
- Find the range of \(\cos x\) on \([0,\pi]\), using bounds, exact values, and the range theorem.
- Give an example of a continuous function on an interval whose range is a singleton, and verify the range directly.