Skip to main content

Section 1.15 Continuity

In this section we explore the notion of continuity of a function. The definition of continuity is most clearly stated in terms of limits: a function \(f\) is continuous at a point \(a\) in its domain if its limit \(\lim\limits_{x\to a}f(x)\) exists there and is equal to its value \(f(a)\text{.}\) Graphically, this means, roughly speaking that the graph of \(f\) has no untoward behavior at \(a\text{:}\) e.g., there are no jumps or asymptotes at \(a\text{,}\) nor any wild oscillations near \(a\text{.}\) As we will see, the property of being continuous at points has many important and useful consequences, including the famous Intermediate value theorem (IVT).

Subsection Continuous functions

Before getting to the official definition of a continuity, we quickly indulge in some technicalities around the notions of interior points and endpoints of domains.

Definition 1.15.1. Interior points and endpoints.

Let \(f\) be a function with domain \(D\text{.}\)
  • Interior point.
    An element \(a\in D\) is an interior point of \(D\) if \(D\) contains an open interval that contains \(a\text{:}\) i.e., \(a\in (c,d)\) and \((c,d)\subseteq D\text{.}\)
  • Endpoints.
    An element \(a\in D\) is a left endpoint of \(D\) if it is not an interior point of \(D\) and \(D\) contains an interval of the form \([a,d)\text{.}\)
    An element \(a\in D\) is a right endpoint of \(D\) if it is not an interior point of \(D\) and \(D\) contains an interval of the form \((c,a]\text{.}\) with \(a\in (c,d)\text{.}\)
    An element \(a\in D\) is an endpoint of \(D\) if it is either left or right endpoint.

Definition 1.15.2. Continuity.

Let \(f\) be a function with domain \(D\text{,}\) and suppose \(a\in D\) is either an interior point or an endpoint of \(D\text{.}\) The function \(f\) is continuous at \(a\) if the limit of \(f\) at \(a\) exists and is equal to the value of \(f\) at \(a\text{:}\) i.e., if
  1. \(\lim\limits_{x\to a}f(x)\) exists, and
  2. \(\lim\limits_{x\to a}f(x)=f(a)\text{.}\)
The function \(f\) is discontinuous at \(a\) if it is not continuous there.
For a subset \(I\subseteq D\text{,}\) we say \(f\) is continuous on \(I\) if \(f\) is continuous at all interior or endpoint points of \(D\) lying in \(I\text{.}\) We say \(f\) is continuous if it is continuous on its entire domain.

Remark 1.15.3. Continuity at \(a\).

Let \(f\) be a function with domain \(D\text{.}\) Observe that our definition of continuity (and discontinuity) only applies to elements of the domain. (In fact, it only applies to elements of the domain that are either interior points or endpoints.)
For example, consider the function \(f(x)=1/x\) with domain
\begin{equation*} D=\R-\{0\}=(-\infty, 0)\cup (0,\infty)\text{.} \end{equation*}
Since \(0\) is not an element of the domain of \(f\text{,}\) we do not say that \(f\) is continuous or discontinuous at \(0\text{.}\)

Remark 1.15.4. Endpoints.

Let \(f\) be a function with domain \(D\text{,}\) and let \(a\in D\) be a right endpoint of \(D\text{.}\) Since by definition \(D\) contains an interval of the form \((c,a]\) but not a full open interval containing \(a\text{,}\) we are in a situation where only the left limit of \(f\) is defined at \(a\text{.}\) Recall (Definitionย 1.11.16) that we define
\begin{equation*} \lim_{x\to a}f(x)=\lim_{x\to a^-}f(x) \end{equation*}
in this case. A similar remark applies to left endpoints of \(D\text{.}\)

Example 1.15.5. Continuity at endpoint.

Let \(f(x)=\sqrt{x}\text{,}\) with domain \(D=[0,\infty)\text{.}\) Decide whether \(f\) is continuous at \(0\text{.}\)
Solution.
First observe that since \(0\) is a left endpoint of \(D\text{,}\) we define
\begin{equation*} \lim_{x\to 0}f(x)=\lim_{x\to 0^+}f(x)\text{.} \end{equation*}
We compute
\begin{align*} \lim_{x\to 0^+}f(x) \amp \lim_{x\to 0^+}\sqrt{x} \\ \amp \sqrt{\lim_{x\to 0^+}x} \amp \text{(root rule)}\\ \amp = \sqrt{0} \amp \text{(poly. eval.)}\\ \amp = 0\text{.} \end{align*}
Thus \(\lim\limits_{x\to 0}f(x)\) exists and is equal to 0. Since \(f(0)=\sqrt{0}=0\text{,}\) we see further that
\begin{equation*} \lim_{x\to 0^+}f(x)=\lim_{x\to 0^+}f(x)=f(0)=0 \end{equation*}
and thus that \(f\) is continuous at \(0\text{.}\)

Remark 1.15.6. Continuity: graphical.

When scanning the graph of a function \(f\) for points of continuity or discontinuity, we look for โ€œproblem pointsโ€. These are locations on the graph where either (a) the limit of the function appears not to exist, or (b) where the limit does exist but does not agree with the value of the function.
A well-loved adage in this regard is the phrase โ€œa continuous function is one whose graph can be traced without lifting the pencilโ€. This is cute, and helpful for guidance, but should not be taken too literally. Indeed, there are some pretty wacky continuous functions out there. For example, the function
\begin{equation*} f(x)=\begin{cases} x\sin(1/x)\amp \text{if } x> 0\\ 0 \amp \text{if } x=0 \end{cases} \end{equation*}
is continuous everywhere on its domain, and yet there are some peculiar properties of its graph that make it unclear it what sense it could be โ€œtraced by a pencilโ€. (Not having defined the sine function yet, we have gotten a little ahead of ourselves. The reader is invited to graph the function above using technology.)

Example 1.15.7. Continuity: graphical.

For the function \(f\) whose graph is given below, find all points of discontinuity and explain what conditions of Definitionย 1.15.2 fail to attain. Make use of some of the following descriptors of discontinuities: โ€œjumpโ€, โ€œremoveableโ€, โ€œoscillatingโ€, โ€œinfiniteโ€.
Graph of complicated function
Figure 1.15.8. Graph of function \(f\)
Solution.
Note that we do not speak of \(f\) being continuous or discontinuous at \(a\text{,}\) as this is not an element of the domain of \(f\text{.}\)
The limit of \(f\) at \(b\) does not exist, since the left limit does not equal the right limit (1.11.15). Thus (i) of Definitionย 1.15.2 fails, and \(f\) is not continuous at \(b\text{.}\) Such a discontinuity is called a jump discontinuity, as the difference between the left- and right-hand limit values is manifested graphically as a discrete jump in the height of the graph of \(f\text{.}\)
The limit of \(f\) at \(c\) exists, and is equal to the value of \(f\) at \(c\text{:}\) that is, we have
\begin{equation*} \lim\limits_{x\to c}f(x)=f(c)=B\text{.} \end{equation*}
Thus (i) and (ii) of Definitionย 1.15.2 are satisfied, and \(f\) is continuous at \(c\text{.}\)
The limit of \(f\) at \(d\) does not exist, since the right-hand limit does not exist. Thus (i) of Definitionย 1.15.2 fails, and \(f\) is not continuous at \(d\text{.}\) Such a discontinuity is called an oscillating discontinuity, as the wild oscillation is the reason why the limit does not exist.
The limit of \(f\) exists at \(e\text{,}\) but is not equal to the value of \(f\) at \(e\text{.}\) In more detail, we have
\begin{equation*} \lim\limits_{x\to e}f(x)=D< f(e)\text{.} \end{equation*}
Thus \(f\) is not continuous at \(e\text{.}\) Such a discontinuity is called a removeable discontinuity as a simple redefining of \(f\) at \(e\) (i.e., setting \(f(e)=D\)) would make the discontinuity disappear.

Example 1.15.9. Continuous everywhere.

Let \(\displaystyle f(x)=\frac{x}{\sqrt{x^2-1}}\text{.}\) Prove, using Definitionย 1.15.2 that \(f\) is continuous.
Solution.
Let \(a\) be any interior element in the implied domain of \(f\text{.}\) By definition of this domain, this means \(a^2-1> 0\text{.}\) It follows that
\begin{align*} \lim_{x\to a}f(x) \amp =\lim_{x\to a}\frac{x}{\sqrt{x^2-1}}\\ \amp =\frac{\lim_{x\to a}x}{\lim_{x\to a}\sqrt{x^2-1}}\\ \amp =\frac{a}{\sqrt{\lim_{x\to a}x^2-1}}\\ \amp = \frac{a}{\sqrt{a^2-1}}\\ \amp = f(a)\text{.} \end{align*}
This computation shows both that (i) \(\lim\limits_{x\to a}f(x)\) exists, and (ii) \(\lim\limits_{x\to a}f(x)=f(a)\text{,}\) and thus by Definitionย 1.15.2, that \(f\) is continuous at \(a\text{.}\) Since \(a\) was an arbitrary element of the domain of \(f\text{,}\) we conclude that \(f\) is continuous at all points of its domain, and hence continuous.
Next we state some theorems that facilitate our (non-graphical) analysis of continuity for a given function. The first result establishes the continuity of some familiar families, proving us with a basic collection of continuous functions.

Proof.

By contrast, our next two theorems give us rules for building new continuous functions out of old ones, allowing us to build up our collection of continuous functions.
Whereas Theoremย 1.15.10 establishes the continuity of some basic families of functions, Theoremย 1.15.11 and Theoremย 1.15.12 tell us that continuity is preserved by all of our familiar function operations (sum, product, quotient, composition, etc.)! As a result, just about any function we build from our starting collection of polynomials and rational functions, is continuous on its entire domain. Since the set family of functions that can be build up from polynomials in this way is precisely the set of algebraic functions, we conclude that all algebraic functions are continuous!
By definition of continuity, \(f\) is continuous at \(a\) if and only if \(\lim\limits_{x\to a}f(x)=f(a)\text{.}\) Now that we know that any algebraic functions is continuous everywhere on their domain, we obtain a sort of super-powered evaluation formula generalizing Theoremย 1.12.6: namely, the algebraic evaluation formula.
As a result of Theoremย 1.15.14 most of the ``easy" limit computations (i.e., limit computations that do not require algebra) we considered in Sectionย 1.12 now become extremely easy, as long as the function \(f\) in question is algebraic, and the limit point \(a\) is in that functionโ€™s domain. Do be careful of that last restriction, however. If \(a\) is not in the domain of \(f\text{,}\) then we cannot use Theoremย 1.15.14, and probably need to resort to algebraic techniques.

Example 1.15.15. Algebraic function evaluation.

Let \(f(x)=\frac{\sqrt{x-1}-3}{x-10}\text{.}\) Compute the following limits.
  1. \(\displaystyle \lim\limits_{x\to 2}f(x)\)
  2. \(\displaystyle \lim\limits_{x\to 10}f(x)\)
Solution.
We first observe that \(f\) is algebraic, with domain
\begin{equation*} D=\{x\in \R\mid x\geq 1 \text{ and } x\ne 10\}=[1,10)\cup (10,\infty)\text{.} \end{equation*}
  1. Since \(f\) is algebraic and \(2\in D\text{,}\) we may use Theoremย 1.15.14 to compute
    \begin{align*} \lim\limits_{x\to 2}f(x) \amp = f(2) \amp (\text{alg. eval.})\\ \amp = \frac{\sqrt{2-1}-3}{2-10}\\ \amp = \frac{-2}{-8}\\ \amp =\frac{1}{4}\text{.} \end{align*}
  2. Note that \(10\notin D\text{,}\) and thus we cannot use Theoremย 1.15.14. As usual we resort to some algebra:
    \begin{align*} \lim\limits_{x\to 10}\frac{\sqrt{x-1}-3}{x-10} \amp= \lim\limits_{x\to 10}\frac{(x-1)-9}{(x-10)(\sqrt{x-1}+3)} \\ \amp= \lim\limits_{x\to 10}\frac{(x-10)}{(x-10)(\sqrt{x-1}+3)} \\ \amp= \lim\limits_{x\to 10}\frac{1}{\sqrt{x-1}+3} \\ \amp= \frac{1}{\sqrt{10-1}+3} \amp (\text{alg. eval.}) \\ \amp= \frac{1}{6} \text{.} \end{align*}
In light of Theoremย 1.15.13, we see that it is actually somewhat difficult to write down a discontinuous function! Piecewise-defined functions give us an easy way of getting around this issue, providing us with a useful source of functions that potentially have discontinuities. Of course, being defined in a piecewise manner does not guarantee the existence of a continuity; consider for the example the absolute value function \(f(x)=\abs{x}\text{,}\) which is continuous, but defined piecewise as
\begin{equation*} \abs{x}=\begin{cases} x \amp x\geq 0\\ -x \amp x< 0 \end{cases}\text{.} \end{equation*}
The example below illustrates in general how we determine whether a piecewise-defined function is continuous at various inputs.

Example 1.15.16. Continuity: piecewise.

Let \(f\colon \R\rightarrow \R\) be defined as
\begin{equation*} f(x)=\begin{cases} c^2x \amp \text{if } x< 1\\ 3cx-2 \amp \text{if } x\geq 1 \end{cases}\text{,} \end{equation*}
where \(c\in \R\) is a fixed constant.
  1. Argue that \(f\) is continuous at all inputs \(a\ne 1\text{.}\)
  2. Find all values of \(c\) for which \(f\) is continuous at the input \(1\text{,}\) and hence everywhere.
Solution.
  1. Take any \(a\in \R\) with \(a\ne 1\text{.}\)
    If \(a< 1\text{,}\) then \(f(x)=cx^2\) for inputs near \(a\text{.}\) Since \(g(x)=cx^2\) is a polynomial, and since polynomials are continuous on their domain, it follows that \(f\) is continuous at \(a\text{.}\)
    Similarly, if \(a\geq 1\text{,}\) then \(f(x)=3cx-2\) for inputs \(x\) near \(a\text{.}\) Again since \(h(x)=3cx-2\) is a polynomial, it is continuous at all such inputs, and hence also at \(a\text{.}\)
    This shows that \(f\) is continuous at \(a\) for all \(a\ne 1\text{,}\) no matter what the value of \(c\text{.}\)
  2. We use the definition of continuity to see what \(c\) must satisfy for \(f\) to be differentiable at \(1\text{.}\) Namely, this is true if and only if
    1. \(\lim\limits_{x\to 1}f(x)\) exists, and further
    2. \(\displaystyle \lim\limits_{x\to 1}f(x)=f(1)\)
    Condition (i) holds if and only if \(\lim\limits_{x\to 1^-}f(x)=\lim\limits_{x\to 1^-}f(x)\text{.}\) We compute both one-sided limits:
    \begin{align*} \lim\limits_{x\to 1^-}f(x) \amp = \lim\limits_{x\to 1^-}c^2x \amp (\text{def., } x< 1)\\ \amp c^2 \amp \text{(poly. eval.)} \\ \lim\limits_{x\to 1^+}f(x) \amp = \lim\limits_{x\to 1^+}3cx-2 \amp (\text{def., } x> 1)\\ \amp 3c-2\amp \text{(poly. eval.)} \text{.} \end{align*}
    We see that (i) is satisfied if and only if \(c^2=3c-2\text{,}\) or
    \begin{equation*} c^2-3c+2=0\text{,} \end{equation*}
    which is true if and only if \(c=1\) or \(c=2\text{.}\)
    It remains to determine which choices of \(c\) guarantee condition (ii). We claim that both work: indeed, since both \(c=1\) and \(c=2\) guarantee that \(\lim\limits_{x\to 1 }f(x)=c^2=3c-2\text{,}\) and since \(f(1)=3c-2\) using the piecewise definition, we conclude that for both choices of \(c\) we have \(\lim\limits_{x\to 1}f(x)=f(1)=3c-2\text{,}\) as desired.
The figure below shows the resulting graph for \(f\text{,}\) taking \(c=1\) and \(c=2\text{.}\) You can think of condition (i) as guaranteeing that our two linear segments join up correctly at \(x=1\text{.}\)
Graph of piecewise-defined function
(a) \(c=1\)
Graph of piecewise-defined function
(b) \(c=2\)
Figure 1.15.17. Graphs of \(f\text{:}\) \(c=1\) and \(c=2\)

Subsection Intermediate value theorem

Recall the cute informal description of a continuous function as one whose graph can be traced without lifting your pencil. This can be further interpreted as saying that as we trace a segment of the graph lying over some interval in the \(x\)-axis, it should not be possible to โ€œskipโ€ over a particular \(y\)-value. Indeed, to skip this value, we would have to lift our pencil. This seems plausible, starting from our cutesy informal description of continuity, but can we prove it rigorously? Yes, we can as witnessed by the intermediate value theorem.

Remark 1.15.19. IVT and existence of solutions.

A common application of the IVT is to prove that an equation of the form \(f(x)=d\) has a solution in a given open interval \((a,b)\text{.}\) Indeed, if \(f\) is continuous on \([a,b]\text{,}\) and if \(d\) lies strictly between \(f(a)\) and \(f(b)\text{,}\) then the IVT guarantees the existence of an element \(c\in (a,b)\) satisfying \(f(c)=d\text{.}\)
Interestingly, however, this method does not actually provide the solution \(c\text{;}\) it only tells us that it exists. This is probably the first time you have encountered what is called a โ€œnonconstructive proofโ€ in mathematics. The theorem tells us that the value \(c\) exists (assuming the necessary conditions hold), but does not explicitly tell us what \(c\) is.

Example 1.15.20. Roots of polynomials.

Show that the polynomial \(f(x)=x^5-x+1\) has a root.
Solution.
A root of \(f\) is an input \(c\) satisfying \(f(c)=0\text{.}\) Since \(f\) is continuous everywhere, the IVT will guarantee the existence of such a \(c\) as long as we can find inputs \(a\text{,}\) \(b\) satisfying \(f(a)> 0\) and \(f(b)< 0\text{.}\) Letโ€™s make a table of values of \(f\) for small inputs \(x\text{:}\)
\begin{equation*} \begin{array}{c|c} x \amp f(x) \\ \hline -1 \amp 1 \\ 0\amp 1 \\ 1 \amp 1\\ 2 \amp 31 \end{array}\text{.} \end{equation*}
This so far is not helpful to us, as all the values are positive. Letโ€™s try another negative value:
\begin{equation*} \begin{array}{c|c} x \amp f(x) \\ \hline -2 \amp -29\\ -1 \amp 1 \\ 0\amp 1 \\ 1 \amp 1\\ 2 \amp 31 \end{array}\text{.} \end{equation*}
Thatโ€™s more like it! Since \(f\) is continuous on \([-2,-1]\text{,}\) and since
\begin{equation*} -29=f(-2)< 0 < f(-1)=1\text{,} \end{equation*}
the IVT now implies there is a \(c\in (-2,-1)\) such that \(f(c)=0\text{.}\)
Observe that this not only shows that \(f\) has a real root, it tells us further that there is a root lying between -2 and -1. Are there any other roots of this function? Further investigation is required. We will have the tools to answer this later.

Example 1.15.21. IVT for an algebraic function.

Prove that the equation
\begin{equation} \sqrt[3]{x-1}+x=2\tag{1.81} \end{equation}
has a solution.
Solution.
Define \(f(x)=\sqrt[3]{x-1}+x-2\text{.}\) The function \(f\) is algebraic and hence continuous on its domain, which is \(\R\text{.}\) Observe that
\begin{align*} f(0) \amp =\sqrt[3]{-1}-2=-1-2=-3\\ f(2) \amp =\sqrt[3]{1}+2-2=1\text{.} \end{align*}
Since \(f\) is continuous on \([0,2]\) and since \(f(0)< 0 < f(2)\text{,}\) the intermediate value theorem implies that there is an element \(c\in (0,2)\) satisfying \(f(c)=0\text{.}\) Setting \(x=c\) gives us a solution to the original equation (1.81).

Remark 1.15.22. Sign diagram technique.

At long last we are able to justify Theoremย 1.8.11, which was the basis of Procedureย 1.8.12, our sign diagram technique for solving inequalities. The crucial claim was that given an algebraic function \(f\) and an interval \(I\) on which \(f\) is defined and never equal to zero, \(f\) is either always positive or always negative on \(I\text{.}\) Letโ€™s see how the intermediate value theorem implies this fact.
Assume \(f\) is an algebraic function, and that the interval \(I\) is a subset of the domain of \(f\text{:}\) i.e., \(f\) is defined at all points in \(I\text{.}\) If \(f\) assumes both positive and negative values on \(I\text{,}\) then we can find points \(a,b\in I\) such that \(a< b\text{,}\) and \(f(a)\) and \(f(b)\) have different signs (i.e., one is positive and the other is negative). But since \(f\) is algebraic, it is continuous, which means in particular that it is continuous at all points in \(I\text{,}\) and hence also on the interval \([a,b]\subseteq I\text{.}\) We now apply the intermediate value theorem: since the signs of \(f(a)\) and \(f(b)\) are different, \(0\) lies between \(f(a)\) and \(f(b)\text{,}\) and thus there is a \(c\in (a,b)\) such that \(f(c)=0\text{.}\) We have shown that if an algebraic function changes sign on an interval in its domain, then it must have a zero in that interval. Equivalently, an algebraic function cannot change sign on an interval in its domain on which it is never equal to zero.
Looking at the argument in Remarkย 1.15.22, we see that we donโ€™t need our function \(f\) to be algebraic for Theoremย 1.8.11, we only need that it is continuous. Thus we have the following more general result.