Continuity is a calculus concept introduced to me first in AP Calculus in high school. We were taught the notion that a real function \( f \) is
Additionally, a real function \( f \) is
However, there was still some circular logic that needed to be resolved. It was common to assume functions were continuous for the purposes of determining a limit (e.g., just plug the value into the limit and evaluate). And these limits would later be used to determine whether the function is continuous.
When I entered college, the foundations of this principle became more rigorous via the \( \epsilon \)-\( \delta \) definition of the limit. The remainder of this article assumes knowledge of the \( \epsilon \)-\( \delta \) definition of the limit. I may write a separate article on this topic another time.
Continuity would have to be built back up using the definition of the limit.
Let's start with the simplest functions. The simplest function is a constant function \( f(x) = c \) for some real value \( c \). Using the \( \epsilon \)-\( \delta \) definition of the limit, this is trivially continuous at all points since the difference \( | f(x) - f(x_0) | \) is identically \( 0 \), which is always less than the chosen \( \epsilon \).
Next is the identity function \( f(x) = x \). This function is continuous because the difference \( |f(x) - f(x_0) | \) is equal to \( |x - x_0 | \), which is always less than \( \delta \). Choosing \( \epsilon = \delta \) completes this one-liner proof.
We can also think of this as a \( 45^{\circ} \) rotation of the constant function, which at least intuitively, should not change the continuity of the function. This leads us to believe all affine functions of the form \( f(x) = ax + b \) are continuous, which is obviously true but still requires proof. Instead of proving this directly using the \( \epsilon \)-\( \delta \) definition of the limit, let's build up more tools in our toolbox.
If \( f \) and \( g \) are continuous, then so is the function \( h(x) = f(x) + g(x) \).
This can be seen via the following quick proof. The difference \( |h(x) - h(x_0)| \) is equivalent to \( | (f(x) + g(x)) - (f(x_0) - g(x_0)) | \). Rearraging, this is the same as \( | (f(x) - f(x_0)) + (g(x) - g(x_0)) | \). Invoking the ever-useful triangle inequality, this is less than or equal to \( |f(x) - f(x_0) | + |g(x) - g(x_0)| \). A priori, since both \( f \) and \( g \) are continuous, we can choose a \( \delta_f \) such that \( |f(x) - f(x_0)| \) is less than \( \epsilon / 2 \) for all \( x \) on the interval \( (x_0 - \delta_f, x_0 + \delta_f) \). Similarly, a \( \delta_g \) can be chosen for \( g \). Therefore, by taking our \( \delta_h \) for the \( h \) function in question to be the smaller of these two \( \delta_f \) and \( \delta_g \), we are guaranteed that \( |f(x) - f(x_0) | + |g(x) - g(x_0)| \) is less than \( \epsilon/2 + \epsilon/2 = \epsilon \).
By applying this rule to the identity function and itself, we see that any function \( f(x) = ax \) is continuous, at least for positive integer \( a \). Applying this rule again with the constant function, we also see that any function \( f(x) = ax + b \) is continuous.
Let's relax the rule that \( a \) has to be a positive integer. \( a \) should be allowed to be any real number.
Choose any nonzero scale factor \( a \) and a continuous function \( f \). Then \( g(x) = af(x) \) is continuous.
To prove, find the \( \delta \) that works with \( \epsilon/|a| \) for \( f \) since \( f \) is continuous, then apply this same \( \delta \) for \( g \).
$$ |g(x) - g(x_0)| = |af(x) - af(x_0)| = |a||f(x) - f(x_0)| = |a|\left(\frac{\epsilon}{|a|}\right) = \epsilon $$
Now, we have any affine function \( f(x) = ax + b \) is continuous for any chosen real numbers \( a \) and \( b \). Combined with the previous fact about sums of continuous functions, this shows that any linear combination of continuous functions is itself continuous.
If \( f \) and \( g \) are continuous, then so is the function \( h(x) = f(x)g(x) \).
This one is a little trickier to prove. Since \( |h(x) - h(x_0)| \) is \( |f(x)g(x) - f(x_0)g(x_0) | \), we need a way to "separate" \( f \) from \( g \) inside the absolute value. We will apply the mathematicians favorite sleight of hand, which is to add and subtract the same value. Which value? Well, since we want to be able to split the absolute value into two separate factors of \( f \) and \( g \), a good choice would be \( f(x)g(x_0) \):
$$ |f(x)g(x) - f(x_0)g(x_0) | = |f(x)g(x) - f(x)g(x_0) + f(x)g(x_0) - f(x_0)g(x_0) | $$
Now, we can factor:
$$ = |f(x)(g(x) - g(x_0)) + (f(x) - f(x_0))g(x_0) | $$
And after applying the triangle inequality:
$$ \leq |f(x)||(g(x) - g(x_0)| + |f(x) - f(x_0)||g(x_0)| $$
This looks better. We can handle the factor of \( g(x_0) \) in the second term since it is a constant. But what about the factor of \( f(x) \) in the first term? That is not a constant.
Well, we know \( f \) is continuous! Then \( |f(x) - f(x_0)| \) is no more than an arbitrary \( \epsilon \), so \( |f(x)| \) is at most \( \epsilon + |f(x_0)| \). This can be seen by applying the triangle inequality (yes this again) to show \( |a| - |b| \leq |a - b| \). Setting \( a \) to be \( f(x) \) and \( b \) to be \( f(x_0) \), then
$$ |f(x)| - |f(x_0)| \leq |f(x) - f(x_0)| \leq \epsilon $$
Rearranging yields \( |f(x)| \leq \epsilon + |f(x_0)| \). Let's put this all together.
For a given \( \epsilon \), choose \( \delta_f \) such that \( |f(x)-f(x_0)| \leq \frac{\epsilon}{2|g(x_0)|} \) and a \( \delta_g \) such that \( |g(x)-g(x_0)| \leq \frac{\epsilon}{2(\epsilon + |f(x_0)|)} \). There is some third \( \delta_{f_{max}} \) such that \( |f(x)| \leq \epsilon + |f(x_0)| \). Choose the overall \( \delta \) to be the smallest of these three values.
Then by this choice of \( \delta \), for all \( x \) on the interval \( (x_0-\delta, x_0+\delta) \), we have:
$$ |f(x)||(g(x) - g(x_0)| + |f(x) - f(x_0)||g(x_0)| \leq (\epsilon + |f(x_0)|)\frac{\epsilon}{2(\epsilon + |f(x_0)|)} + \frac{\epsilon}{2|g(x_0)|}g(x_0) $$
Simplifying, this is \( \epsilon \). This means we can multiply any two continuous functions and yield another continuous function. Namely, all polynomial functions are continuous!
We will next show that \( f(x) = 1/x \) is continuous. However, it is not continuous on all real numbers, since it is undefined at \( x = 0 \). But if we restrict the domain to all positive real numbers (denoted \( \mathbb{R}^+ \)), then we can show it is continuous on this restricted domain. This is our first example of a continuous function with a domain other than all real numbers. We will need to be careful to ensure we avoid any inputs outside of this domain.
As with most proofs, we will need to transform \( |1/x - 1/x_0| \) into something that is less than \( |x - x_0| \) up to some constant factor that may depend on \( x_0 \). We can find a common denominator and write:
$$ \left|\frac{1}{x} - \frac{1}{x_0}\right| = \left|\frac{x_0-x}{xx_0}\right| = \frac{|x-x_0|}{xx_0} < \frac{\delta}{xx_0} $$
The absolute value is dropped in the denominator since both \( x \) and \( x_0 \) are positive. \( |x-x_0| \) will be less than \( \delta \) for our choice of \( \delta \). We have to deal with the factor of \( xx_0 \) in the denominator. The \( x_0 \) is easy since it is a fixed value. However, \( x \) can vary, but we can bound it above on a suitable interval.
In fact, it will be easier to prove the continuity of \( 1/x \) by looking at overlapping subintervals that together union to form \( \mathbb{R}^+ \). We will choose intervals \( [\frac{1}{n+2},\frac{1}{n}) \) and \( [n,n+2) \) for all natural numbers \( n \). Every real number is in one of these intervals (but not an endpoint) because they are overlapping. For example, 2 is the endpoint of the interval \( [2, 4) \) but is not an endpoint of \( [1, 3) \). The exception here is the number 1, so we will add another interval \( [1/2, 3/2) \) for the number 1.
Let's proceed by looking at each interval case by case. If the \( x_0 = 1 \), then the chosen interval is \( [1/2, 3/2) \). As \( f(x) = 1/x \) is a decreasing function, the maximum value of \( f \) this interval is at the lower endpoint \( x = 1/2 \) which evalutes to a maximum value of 2. We choose \( \delta = \epsilon/2 \) or \( \delta = 1/2 \), whichever is smaller, in order to guarantee all values are on the interval \( [1/2, 3/2) \). Then:
$$ \left|\frac{1}{x} - \frac{1}{x_0}\right| < \frac{\delta}{xx_0} \leq \frac{\epsilon}{2}\cdot\frac{1}{x} \leq \frac{\epsilon}{2}\cdot 2 = \epsilon $$
We will approach the other intervals in a similar fashion. If \( x_0 > 1 \), then there is a natural number \( n \) such that \( x_0 \neq n \) and \( x_0 \) is contained in \( [n,n+2) \). We can choose some \( w \) such that \( (x_0-w/2,x_0+w/2) \) is contained within the set \( [n,n+2) \). Note the maximum value of \( f(x) = 1/x \) on this interval is \( 1/n \). We also choose \( \delta \) as the smaller of \( w/2 \) or \( \epsilon n \). Plugging in these values:
$$ \left|\frac{1}{x} - \frac{1}{x_0}\right| < \frac{\delta}{xx_0} \leq \frac{\delta}{n} \leq \epsilon n \cdot \frac{1}{n} = \epsilon $$
Finally, assume \( 0 < x_0 < 1 \). Then we locate the interval \( [\frac{1}{n+2},\frac{1}{n}) \) containing \( x_0 \) for some natural number \( n \) such that \( x_0 \neq \frac{1}{n+2} \). Again we choose some \( w \) such that \( (x_0-w/2,x_0+w/2) \) is contained within the set \( [\frac{1}{n+2},\frac{1}{n}) \). Also, the maximum value of \( f(x) = 1/x \) on this interval is \( n+2 \). Lastly, choose \( \delta \) as the smaller of \( w/2 \) or \( \frac{\epsilon x_0}{n+2} \). Plugging in these values:
$$ \left|\frac{1}{x} - \frac{1}{x_0}\right| < \frac{\delta}{xx_0} \leq \frac{\epsilon x_0}{n+2}\cdot\frac{n+2}{x_0} = \epsilon $$
If \( f \) and \( g \) are continuous and composable (i.e., the domain of \( f \) contains the range of \( g \)), then \( h(x) = (f \circ g)(x) = f(g(x)) \) is continuous.
This one will be rather straightforward compared to the previous couple of proofs. We will need to look at \( |h(x)-h(x_0)| = |f(g(x)) - f(g(x_0))| \). Label \( y = g(x) \) and \( y_0 = g(x_0) \). Since \( f \) is continuous, then we can choose a \( \delta_f \) such that \( |f(y) - f(y_0)| < \epsilon \) for \( |y - y_0| < \delta_f \). Now substitute back \( |g(x)-g(x_0)| < \delta_f \). Since \( g \) is continuous, we can find a \( \delta_g \) such that \( |g(x)-g(x_0)| < \delta_f \) for \( |x-x_0| < \delta_g \). Putting this together, we have found a \( \delta_g \) where if \( |x-x_0| < \delta_g \), then \( |h(x)-h(x_0)| < \epsilon \) as required.
With this result coupled with previous results, we can compose any polynomial with the function \( 1/x \) so long as we restrict the domain to exclude where the polynomial is 0 in order to show that any rational function is continuous wherever the denominator is not zero.
Suppose \( f \) is continuous with inverse \( f^{-1} \). Set \( y = f(x) \) and \( y_0 = f(x_0) \). Or in other words, \( x = f^{-1}(y) \) and \( x_0 = f^{-1}(y_0) \). We aim to show \( f^{-1} \) is continuous on the appropriate domain.
Pick an \( \epsilon > 0 \). We want to find a \( \delta_{f^{-1}} \) such that \( |f^{-1}(y)-f^{-1}(y_0)| < \epsilon \) whenever \( |y-y_0| < \delta_{f^{-1}} \).
By the continuity of f, we can find a \( \delta_f \) where \( |f(x)-f(x_0)| < \epsilon \) whenever \( |x-x_0| < \delta_f \).
If \( \delta_f \leq \epsilon \), then we are done. We choose \( \delta_{f^{-1}} = \epsilon \) and pick \( y \) where \( |y-y_0| = |f(x)-f(x_0)| < \delta_{f^{-1}} = \epsilon \). The inverses of \( y \) and \( y_0 \) must come from the interval \( (x_0-\delta_f,x_0+\delta_f) \). This means \( |f^{-1}(y)-f^{-1}(y_0)| = |x-x_0| < \delta_f < \epsilon \).
So what if \( \delta_f \geq \epsilon \)? We will scale the function in order to make it work! Define \( g(x) = f(\frac{\delta_f}{\epsilon}x) \). Then g is invertible and continuous since f is. For all x such that \( |x-x_0| < \delta_f \), we have \( |g(\frac{\epsilon}{\delta_f}x)-g(\frac{\epsilon}{\delta_f}x_0)| < \epsilon \). Let's change variables with \( u = \epsilon/\delta_f x \), or \( x= \frac{\delta_f}{\epsilon}u \). Then for all u such that \( |u-u_0| < \epsilon \), we have \( |g(u)-g(u_0)| < \epsilon \). By the previous argument, then \( g^{-1} \) is continuous. But \( f^{-1} \) is a scale factor times \( g^{-1} \) which means \( f^{-1} \) is continuous as well.
This would be easy to prove using derivatives. Taking the derivative of \( e^x - x - 1 \) yields \( e^x - 1 \) which has a single critical point at 0. The second derivative is \( e^x \) which is always positive. Therefore at the critical point 0, the function achieves a minimum value of zero. The function is otherwise always positive. And so \( e^x - x - 1 \geq 0 \), which finishes the proof.
However, since we are using this tool for a proof of continuity which is needed before introducing derivatives, the proof should not depend on the use of derivatives.
We can make use of the definition of \( e^x \), which I introduced here
$$ e^x = \lim_{N \to \infty}\left(1 + \frac{x}{N}\right)^N $$
For nonnegative \( x \), each term in the sum is nonnegative. We can throw away all terms except the first two in the binomial expansion to get that \( e^x \geq 1 + \binom{N}{1}\frac{x}{N} = 1+x \).
For \( x \leq -1 \), we have \( x+1 \leq 0 \) and \( e^x > 0 \). Therefore \( e^x \geq x+1 \).
For \( -1 < x < 0 \), we have to be a bit more careful. We know that \( |x| > |x^2| > |x^3| \cdots \). In the binomial expansion for \( e^x \), this means each pair of terms is positive, so we can throw out all terms but the first pair. This gives \( e^x \geq x+1 \). I realize this part is a bit handwavy so I will explore this in more detail in the future.
\( \ln(x+1) \leq x \) immediately follows from \( e^x \geq x+1 \). Or stated differently, \( \ln x \leq x - 1 \).
Now, to show the continuity of \( \ln x \), we can see that \( |\ln(x)-\ln(x_0)| \) is equal to \( |\ln(\frac{x}{x_0})| \) by logarithm rules. Applying the rule we just derived, this is less than or equal to \( |\frac{x}{x_0}| - 1 \), which is equal to \( \frac{x-x_0}{x_0} \). Therefore,
$$ |\ln(x)-\ln(x_0)| \leq \frac{|x-x_0|}{|x_0|} $$
thereby choosing \( \delta = \epsilon x_0 \) works to show \( \ln \) is continuous.
It immediately follows that the inverse of \( \ln x \), namely \( e^x \), is also continuous.
It suffices to show that \( \sin x \) is continuous, as all other trig functions can be built out of sine as long as we restrict the domains to a suitable interval.
\( | \sin x - \sin x_0 | \) is equal to \( |2\cos\frac{x+x_0}{2}\sin\frac{x-x_0}{2}| \) using a known trig identity. We know that \( \cos \) is always less than or equal to 1, so we can just remove the cosine term as long as we add a less than or equal sign:
$$ |2\cos\frac{x+x_0}{2}\sin\frac{x-x_0}{2}| \leq |2\sin\frac{x-x_0}{2}| $$
We also know from a well-known result of the sine function that \( \sin x \leq x \) for all \( x \).
$$ |2\sin\frac{x-x_0}{2}| \leq |2\frac{x-x_0}{2}| = |x-x_0| $$
Therefore, given an \( \epsilon > 0 \), we can choose \( \delta = \epsilon \) to prove that \( \sin x \) is continuous.
Since \( \cos x \) is the same as \( \sin(\frac{\pi}{2}-x) \), it is a composition of continuous functions and is also continuous.
Since \( \tan x \) is \( \frac{\sin x}{\cos x} \), then \( \tan x \) is continuous on any interval wherever \( \cos x \neq 0 \).
All the trigonometric inverse functions (\( \arcsin, \arccos, \arctan \)) are continuous on the appropriate intervals following from the results we already derived.
All functions normally encountered in a calculus class are continuous (on the appropriate intervals). And we've proven this using basic facts and not any calculus encountered after continuous functions (like derivatives).
In fact, it is rather difficult to come up with a function that is not continuous on some part of an open interval, although they do exist. I might do a write-up on this in the future.