$$ \newcommand{\RR}{\mathbb{R}} \newcommand{\QQ}{\mathbb{Q}} \newcommand{\CC}{\mathbb{C}} \newcommand{\NN}{\mathbb{N}} \newcommand{\ZZ}{\mathbb{Z}} \newcommand{\FF}{\mathbb{F}} % ALTERNATE VERSIONS % \newcommand{\uppersum}[1]{{\textstyle\sum^+_{#1}}} % \newcommand{\lowersum}[1]{{\textstyle\sum^-_{#1}}} % \newcommand{\upperint}[1]{{\textstyle\smallint^+_{#1}}} % \newcommand{\lowerint}[1]{{\textstyle\smallint^-_{#1}}} % \newcommand{\rsum}[1]{{\textstyle\sum_{#1}}} \newcommand{\uppersum}[1]{U_{#1}} \newcommand{\lowersum}[1]{L_{#1}} \newcommand{\upperint}[1]{U_{#1}} \newcommand{\lowerint}[1]{L_{#1}} \newcommand{\rsum}[1]{{\textstyle\sum_{#1}}} \newcommand{\partitions}[1]{\mathcal{P}_{#1}} \newcommand{\sampleset}[1]{\mathcal{S}_{#1}} \newcommand{\erf}{\operatorname{erf}} $$

14  Continuity

Highlights of this Chapter: we formalize the concept of continuity, one of the foundational definitions in the analysis of functions. We provide an equivalent definition built out of sequences, and use it to prove ‘continuity analogs’ of the limit theorems. Finally, we prove that continuous functions are determined by their values on a dense set, an oft-useful result allowing one to reduce various arguments to considerations about rational numbers.

What does continuity mean? In pre-calculus classes, we often first hear something like “you can draw the graph without picking up your pencil”. This is a good guide to start with for a formal definition: its clearly capturing some property that is easy to check by visual inspection! But it’s not precise: terms like “you” and “pencil”, as well as modal phrases like “can draw” are nowhere to be found in the axioms of ordered fields! How can we say the same thing, using words we have access to?

First, a function is an input-output machine, so we should rephrase things in terms of inputs and outputs. When a graph makes a jump (where you’d have to pick up your pencil), the output changes a lot even when the input barely does. Thus, not having to pick up your pencil means you change the input by a little bit, the output changes by a little bit.

This is totally something we can make precise! A good start is by giving names to things: we want to say for any change in the input smaller than some \(\delta\), we know the output cant change that much: maybe its maximum is some other small change \(\epsilon\):

Definition 14.1 (\(\epsilon\)-\(\delta\) continuity) A function \(f\) is continuous at a point \(a\) in its domain if for every \(\epsilon>0\) there is some threshold \(\delta\) where if \(x\) is within \(\delta\) of \(a\), then \(f(x)\) is within \(\epsilon\) of \(f(a)\). As a logic sentence: \[\forall \epsilon>0\,\exists\delta>0\, \forall x\, |x-a|<\delta\implies |f(x)-f(a)|<\epsilon\]

A function is continuous on a set \(X\subset\RR\) if it is continuous at \(a\) for each \(a\in\RR\). A function is continuous if it is continuous on its domain.

14.1 Using the \(\epsilon-\delta\) Definition

This definition looks a lot like the sequence definition, at least in terms of the order of the quantifiers. And this is a good thing for us, who are now experts at the sequence definition!

Example 14.1 Any constant function \(f(x)=c\) is continuous at every real number \(a\).

Example 14.2 The function \(y=x\) is continuous at every real number \(a\).

This generalizes directly to functions like \(f(x)=2x+1\), where now for a fixed \(\epsilon\) we may wish to take \(\delta=\epsilon/2\) after some scratch work:

Exercise 14.1 Show that linear functions \(y=mx+b\) are continuous at every \(a\in\RR\).

Exercise 14.2 Prove that the function \(f(x)=|x|\) is continuous at \(x=0\). Then use the fact that \(f(x)=x\) for \(x>0\) and \(f(x)=-x\) for \(x<0\) (which are linear functions) to conclude that \(|x|\) is continuous at every real number.

Like any definition, its good after seeing a few examples to also turn and look at non-examples:

Example 14.3 The step function \[h(x)=\begin{cases} 0 & x\leq 0\\ 1 & x>0 \end{cases}\] is discontinuous at \(0\), but is continuous at all other real numbers.

Thus, a function with a jump in it is discontinuous right at the jump, as we expect. This shows its possible for a function to be discontinuous at a single point, but things can get much stranger!

Example 14.4 The characteristic function of the rational numbers is discontinuous everywhere. \[b(x)=\begin{cases} 1 & x\in\QQ\\ 0 & x\not\in\QQ \end{cases}\]

We saw above a function that is discontinuous at a single point, and then one that is discontinuous everywhere. What’s harder to imagine, is a function that is continuous at a single point. Try thinking about what this might mean!

Exercise 14.3 Show that the following function is continuous at \(0\) and discontinuous everywhere else:

\[g(x)=\begin{cases} x & x\in \QQ\\ 0 & x\not\in\QQ \end{cases}\]

While the \(\epsilon-\delta\) definition is nice in that it looks like the sequence definition, we still end up having to play the \(\epsilon\) game with every argument. Indeed, while some functions are well-suited these, for other relatively simple looking arguments, picking the right \(\delta\) actually turns out to be a bit of work!

Exercise 14.4 Prove that \(f(x)=x^2\) is a continuous function using the \(\epsilon-\delta\) definition.

To avoid having to do such hard work on a regular basis, we will seek to broaden our theoretical toolkit.

14.2 Continuity With Sequences

We spent a lot of time working with sequences so far, so it would be nice if we could leverage some of that knowledge as more than just analogy. And indeed we can! In this section, we introduce an alternative definition of continuity, and prove that it is equivalent to our original.

Definition 14.2 (Continuity) Let \(f\) be a real valued function with domain \(D\subset \RR\) and \(a\in D\) a point. Then \(f\) is continuous at \(a\) if for every convergent sequence \(\{x_n\}\subset D\) with \(x_n\to a\), the limit can be taken either before or after applying \(f\): \[\lim f(x_n)=f(\lim x_n)=f(a)\] A function is continuous on a set \(S\subset D\) if it is continuous at each point of \(S\).

Thus, we can think of continuity as the condition that allows us to “pull the limit inside of \(f\)”. It is immediate from the definition that constant functions are continuous at every point of their domain, as is the function \(f(x)=x\).

Example 14.5 The function \(f(x)=x^2\) is continuous on the entire real line.

Proof. Let \(a\in\RR\) be arbitrary, and let \(x_n\) be an arbitrary sequence converging to \(a\). Then by the limit theorem for products, we see that since \(x_n\to a\), it follows that \(x_n^2\to a^2\). Thus, if \(f(x)=x^2\) we have \[\lim f(x_n) = \lim x_n^2 = a^2= f(a)=f(\lim x_n)\] So, \(f\) is continuous at \(x=a\). Since \(a\) was an arbitrary real number, \(f\) is continuous on the entire real line.

Theorem 14.1 (Equivalence of Continuity Definitions) Let \(f\) be a real function, and \(a\) a point of its domain. Then \(f\) is continuous by the sequence definition if and only if it is continuous by the \(\epsilon\)-\(\delta\) definition.

This theorem is an equivalence of definitions or an if-and-only-if result, so the proof requires two parts: first we show that continuity implies sequence continuity, and then we show the converse.

Proof (Continuity Implies Sequence Continuity). Let \(f\) be continuous at \(a\), and \(x_n\) an arbitrary sequence converging to \(a\). We wish to show the sequence \(f(x_n)\) converges to \(f(a)\). Choosing an \(\epsilon>0\), we use the assumed continuity to get a \(\delta>0\) where \(|x-a|<\delta\) implies that \(|f(x)-f(a)|<\epsilon\).

But since \(x_n\to a\), we know there must be some \(N\) such that for \(n>N\) we have \(|x_n-a|<\delta\): thus for this same \(N\) we have \(|f(x_n)-f(a)|<\epsilon\).

Putting this all together, this is just the definition of convergence for the sequence \(f(x_n)\) to \(f(a)\): starting with \(\epsilon>0\) we got an \(N\) which for \(n>N\) we can guarantee \(|f(x_n)-f(a)|<\epsilon\). So we are done.

Proof (Sequence Continuity Implies Continuity). Here we prove the contrapositive: that if \(f\) is not continuous at \(a\) then it is also not sequence continuous there.

If \(f\) is not continuous at \(a\) then there is some \(\epsilon\) where for every \(\delta>0\) we can find points within \(\delta\) of \(a\) where \(f(x)\) is more than \(\epsilon\) away from \(f(a)\). From this we need to somehow produce a sequence, so we will take a sequence of such \(\delta\)’s and for each pick some such bad point \(x\).

For example, if we let \(\delta=1/n\) then call \(x_n\) the point with \(|x_n-a|<1/n\) but \(|f(x_n)-f(a)|>\epsilon\). Doing this for all \(n\) produces a sequence where \[a-\frac{1}{n}<x_n<a+\frac{1}{n}\] And so by the squeeze theorem we see that \(x_n\) converges, and its limit is \(a\). But we also know (by our choices of \(x_n\)) that for every element of this sequence |f(x_n)-f(a)|>$, so there’s no way that \(f(x_n)\) converges to \(f(a)\).

Thus, we’ve shown by example that our function is not sequence continuous at \(a\), as required.

When working with this definition of continuity, its important to remember that we need to check \(f(\lim x)=\lim f(x_n)\) for all sequences \(x_n\to a\). If it fails for any individual sequence, that is enough to show the function is not continuous at that point. Thus when proving continuity we will always start with let \(x_n\) be an arbitrary sequence converging to \(a\), and make use of convergence theorems to help us (since we cannot know the particular sequence), whereas for proving discontinuity all we need to do is produce a specific example sequence that fails.

Exercise 14.5 The function \[\mathrm{sgn}(x)=\begin{cases} -1 & x<0\\ 0 & x=0\\ 1 &x>0 \end{cases}\] is discontinuous at \(x=0\), but continuous at every other real number.

Its useful to have two definitions, as often one will be easier to use than the other. Below we will see many examples where sequence continuity is easier to apply, but here’s an example where \(\epsilon-\delta\) continuity makes things clearer.

Proposition 14.1 Let \(f\) be a continuous function, and assume that \(f(c)\neq 0\) for some point \(c\in\RR\). Then there exists a small interval \((c-\delta,c+\delta)\) on which \(f(x)\neq 0\) for all \(x\) in the interval.

Proof. Let \(\epsilon= |f(c)|/2\). Then by continuity, there is some \(\delta\) such that if \(|x-c|<\delta\) we know \(|f(x)-f(c)|<\epsilon\). Unpacking this, for all \(x\in(c-\delta, c+\delta)\) we know

\[-\epsilon=\frac{-|f(c)|}{2} < f(x)-f(c)<\frac{|f(c)|}{2}=\epsilon\]

And thus

\[f(c)-\frac{|f(c)|}{2}< f(x)<f(c)+\frac{|f(c)|}{2}\]

If \(f(c)\) is positive, then the lower bound here is \(f(c)/2\) which is still positive, so \(f(x)\) is always positive in the interval. And, if \(f(c)\) is negative, the upper bound here is \(f(c)/2\) which is still negative: thus \(f(x)\) is always negative in the interval.

14.3 Analogs of the Limit Theorems

Beause we have an equivalent characterization of continuity in terms of sequence convergence, and we have many theorems about this, we can use our characterization to rephrase these as results about continuity.

Proposition 14.2 (Continuity of Multiples) If \(f\) is continuous at \(a\in\RR\) and \(k\in\RR\) is a constant, then the function \(kf\colon x\mapsto kf(x)\) is continuous at \(a\).

Proof. Let \(a\in\RR\) be arbitrary, and \(x_n\) a sequence converging to \(a\). Then by the limit theorem for multiples, \(kx_n\to ka\). Rephrasing this in terms of the function \(f(x)=kx\), this just says that \(\lim f(x_n)=f(\lim x_n)\) so \(f\) is continuous at \(a\).

Theorem 14.2 (Continuity of Field Operations) Let \(f,g\) be functions which are continuous at a point \(a\). Then the functions \(f(x)+g(x),f(x)-g(x)\) and \(f(x)g(x)\) are all continuous at \(a\). Furthermore if \(g(a)\neq 0\) then \(f(x)/g(x)\) is also continuous at \(a\).

Proof. Let \(f,g\) be any two continuous functions and let \(a\in\RR\) be a point in their domains. Let \(x_n\) be any sequence converging to \(a\). Since \(f\) is continuous we know that \(\lim f(x_n)=f(\lim x_n)=f(a)\) and similarly by the continuity of \(g\), \(\lim g(x_n)=f(\lim x_n)=g(a)\). Thus by the limit theorem for sums, the sequence \(f(x_n)+g(x_n)\) is convergent, with \[\lim\left(f(x_n)+g(x_n)\right)=\lim f(x_n)+\lim g(x_n)=f(a)+g(a)\] So, \(f+g\) is continuous at \(a\). Since \(a\) was arbitrary, we see that \(f+g\) is continuous at every point of its domain. The same argument applies for subtraction, multiplication, and division using the respective limit theorems for sequences.

One of the most important operations for functions is that of composition: if \(f\colon \RR\to\RR\) and \(g\colon\RR\to\RR\) then the function \(g\circ f\colon\RR\to\RR\) is defined as \(g\circ f(x):=g\left(f(x)\right)\). More generally, so long as the domain of \(g\) is a subset of the range of \(f\), the composition \(g\circ f\) is well defined.

Theorem 14.3 (Continuity of Compositions) Let \(f, g\) be functions such that \(f\) is continuous at \(a\), and \(g\) is continuous at \(f(a)\). Then the composition \(g\circ f(x):=g(f(x))\) is continuous at \(a\).

Proof. Let \(x_n\) be an arbitrary sequence converging to \(a\in\RR\): we wish to show that \(\lim g(f(x_n))=g(f(\lim x_n))=g(f(a))\). Since \(f\) is continuous at \(x=a\) we see immediately that \(f(x_n)\) is a convergent sequence with \(f(x_n)\to f(a)\). And now, since \(g\) is assumed to be continuous at \(x=f(a)\) and \(f(x_n)\) is a sequence converging to this point, we know \(g(f(x_n))=g(f(a))\) as required.

Exercise 14.6 Let \(f(x)\) be a continuous function, and assume that \(f(x)^2\) is a constant function. Prove that \(f(x)\) is constant.

Give an example of an \(f(x)\) where \(f(x)^2\) is constant, but \(f\) is not.

Theorem 14.4 (Continuity of Roots) The function \(R(x)=\sqrt{x}\) is continuous on \([0,\infty)\).

Proof. Actually we already proved this, before we had the terminology! Re-read ?exr-limit-of-root: it shows that if \(x_n\to a\) is a convergent sequence with \(x_n\geq 0\) and \(a\geq 0\), then \(\sqrt{x_n}\to\sqrt{a}\). So \(\lim \sqrt{x_n}=\sqrt{\lim x_n}\), and \(\sqrt{x}\) is continuous at the arbitrary nonnegative real \(a\).

The same is true for \(n^{th}\) roots, though we do not stop to prove it here, you may wish to for practice!

14.4 Useful Examples

Because continuity is going to be a big part of our course, its good to have a couple examples of functions we already know to be continuous. The ones below are particularly useful:

Exercise 14.7 (Continuity of Polynomials) Prove that every polynomial is a continuous function on the entire real line. Hint: induction on the degree of the polynomial!

Exercise 14.8 (Continuity of Rational Functions) A rational function is a quotient of polynomials \(r(x)=p(x)/q(x)\). Prove that every rational function is continuous, on every point of its domain.

Exercise 14.9 If \(f\) is continuous at a point \(a\), then \(|f|\) is continuous there.

Hint: either use the reverse triangle inequality (?exr-reverse-triangle-inequality) or use that its a composition

Exercise 14.10 (Continuity of Max and Min) Prove that for any two numbers \(x,y\) we can express the max and min by the following formulas: \[FORMULAS\]

Use this, together with the limit theorems on field operations and continuity to prove that for any two continuous functions \(f(x),g(x)\) that the functions \(\max\{ f(x),g(x)\}\) and \(\min\{f(x),g(x)\}\) are continuous.

Putting all this together, we already can build many examples of continuous functions! For example,

\[\frac{|3x^2+2x-1|^7\max\{7x, 2x^2+3\}}{4(3x^2+11)}\]

Exercise 14.11 Prove carefully that the above function is continuous at every \(a\in\RR\), using the theorems and examples developed above.

14.5 Continuity and the Rationals

Before closing the introductory chapter on continuity, we turn to one important theoretical tool: the density of the rationals. Because every real number is the limit of a sequence of rationals, and continuous functions are determined by limits, it seems that continuous functions are rather constrained by their value on the rationals. This is indeed true, and will prove quite useful: we prove it in two steps below.

Proposition 14.3 If \(f\) is a continuous function such that \(f(r)=0\) for every rational number \(r\), then \(f=0\) is the zero function.

Proof. Let \(f\) be such a function, and \(a\in\RR\) any real number. Then there is a sequence \(r_n\) of rational numbers converging to \(a\). Given that \(f\) is zero on all rationals, we see that \(f(r_n)=0\) for all \(n\). Thus \(f(r_n)\) is the constant zero sequence, and so its limit is zero: \[\lim f(r_n)=\lim 0 = 0\] But, since \(f\) is assumed to be continuous, we know that we can move the limit inside of \(f\): \[0=\lim f(r_n)=f\left(\lim r_n\right)=f(a)\] Thus \(f(a)=0\), and since \(a\) was arbitrary, we see \(f\) is the constant function equal to zero at all real numbers.

Corollary 14.1 Let \(f,g\) be continuous functions such that for all \(r\in\QQ\) they are equal: \(f(r)=g(r)\). Then in fact, \(f=g\): for all \(x\in\RR\), \(f(x)=g(x)\)

Proof. Since \(f\) and \(g\) are continuous, the function \(h=f-g\) is continuous using the theorems for field operations. And, since \(f(x)=g(x)\) for all rational \(x\), we see \(h(x)=0\) on the rationals. Thus, by Proposition 14.3, \(h\) itself must be the zero function on all of \(\RR\). Thus for every \(x\), \(h(x)=f(x)-g(x)=0\), or rearranging, \[\forall x,\, f(x)=g(x)\]

This has a the pretty significant consequence that if we have a function and we know it is continuous, then being able to calculate its values at the rational numbers is good enough to completely determine the function on the real line. In particular, this can be used to prove various uniqueness results: you can show a certain function is uniquely defined if you can prove that its definition implies (1) continuity and (2) determines the rational points (or more generally, the values on a dense set).

Exercise 14.12 Let \(X\subset\RR\) be any dense subset. Prove that if \(f\) is a continuous function then it is completely determined by its values on \(X\) by showing

  • Every real number is the limit of some sequence \(x_n\) of points in \(X\).
  • If \(f\) is continuous \(f(x)=0\) on all points of \(x\), then \(f\) is the zero function.
  • If \(f,g\) are two continuous functions with \(f(x)=g(x)\) for \(x\in X\), then they are the same function.

We will use this property in understanding exponential functions (where their value at rational numbers are determined by powers and roots) and trigonometric functions (whose values on certain dyadic multiples of \(\pi\) are determined by the half-angle identities.)