# Continuous Functions

In calculus, a **continuous function** is a real-valued function whose graph does not have any breaks or holes. Continuity lays the foundational groundwork for the intermediate value theorem and extreme value theorem. They are in some sense the ``nicest" functions possible, and many proofs in real analysis rely on approximating arbitrary functions by continuous functions.

## Definition

In calculus, knowing if the function is continuous is essential, because differentiation is only possible when the function is continuous. The concept of continuity is simple: If the graph of the function doesn't have any breaks or holes in it within a certain interval, the function is said to be continuous over that interval. Thus, simply drawing the graph might tell you if the function is continuous or not. However not all functions are easy to draw, and sometimes we will need to use the definition of continuity to determine a function's continuity. The mathematical definition of a continuous function is as follows:

For a function \(f(x)\) to be continuous at a point \(x=a\), it must satisfy the first three of the following conditions:

\(\quad\)

(i)\(f(a)\) exists.\(\quad\)

(ii)\(\displaystyle{\lim_{x\rightarrow a}f(x)}\) exists.\(\quad\)

(iii)\(\displaystyle{\lim_{x\rightarrow a}f(x)}=f(a).\)\(\quad\)

(iv)For all \(\varepsilon > 0\), there exists \(\delta > 0\) such that \(|x-a|<\delta,x \neq a\) implies that \(\big|f(x)-f(a)\big|<\varepsilon.\)

When we say a function \(f\) is continuous on \([a,b],\) it means that, for all elements in the interval, the above conditions are satisfied. But do note that while trying to prove continuity on \([a,b],\) we don't have to take into account LHL for \(a\) and RHL for \(b\) as the points to the left of \(a\) and to the right of \(b\) are not included in \([a,b].\) We only consider RHL for \(a\) and LHL for \(b.\)

## Examples

Here are a few example problems. Using the definition above, try to determine if they are continuous or not.

## Is the function \(\displaystyle{f(x)=\begin{cases}2x+1\ (x<3)\\3x-2\ (x\geq3)\end{cases}}\) continuous for all \(x\in\mathbb{R}?\)

We know that the graphs of \(y=2x+1\) and \(y=3x-2\) are continuous, so we only need to see if the function is continuous at \(x=3.\) The procedure is simply using the definition above, as follows:

(i)Since \(f(3)=3\times3-2=7,\) \(f(3)\) exists.

(ii)In order to see whether the limit exists or not, we have to check the limit from both sides. The left-hand and right-hand limits are\[\lim_{x\rightarrow3^{-}}f(x)=\lim_{x\rightarrow3^{-}}(2x+1)=2\times3+1=7 ~~\text{ and }~~ \lim_{x\rightarrow3^{+}}f(x)=\lim_{x\rightarrow3^{+}}(3x-2)=3\times3-2=7,\]

respectively. Because the limits from both sides are equal, \(\displaystyle{\lim_{x\rightarrow3}}f(x)\) exists.

(iii)Now from (i) and (ii), we have \(\displaystyle{\lim_{x\rightarrow3}}f(x)=f(3)=7,\) so the function is continuous at \(x=3.\) \( _\square \)

## Is the function \(\displaystyle{f(x)=\begin{cases}x+1&(x<2)\\x^2&(x=2)\\2x-1&(x>2)\end{cases}}\) continuous for all \(x\in\mathbb{R}?\)

We know that the graphs of \(y=x+1,\) \(y=x^2,\) and \(y=2x-1\) are continuous, so we only need to see if the function is continuous at \(x=2.\) Again we use the same procedure, as shown below:

(i)Since \(f(2)=2^2=4,\) \(f(2)\) exists.

(ii)The left-hand and right-hand limits are\[\begin{align} \displaystyle{\lim_{x\rightarrow2^{-}}}f(x)&=\displaystyle{\lim_{x\rightarrow2^{-}}}(x+1)=3\\ \displaystyle{\lim_{x\rightarrow2^{+}}}f(x)&=\displaystyle{\lim_{x\rightarrow2^{+}}}(2x-1)=3, \end{align}\]

respectively. Therefore, \(\displaystyle{\lim_{x\rightarrow2^{-}}}f(x)=\displaystyle{\lim_{x\rightarrow2^{+}}}f(x)=\displaystyle{\lim_{x\rightarrow3}}f(x)=3.\)

(iii)Now from (i) and (ii), we have \(\displaystyle{\lim_{x\rightarrow2}}f(x)\neq f(2),\) so the function is not continuous at \(x=2.\)

The graph of the function would look like the figure above. Observe that there is a "hole" at \(x=2,\) which causes the discontinuity. \( _\square \)

## Is the function \(\displaystyle{f(x)=\begin{cases}-x^3+x+1\ (x\leq1)\\2x^2+3x-2\ (x>1)\end{cases}}\) continuous for all \(x\in\mathbb{R}?\)

We know that the graphs of \(y=-x^3+x+1\) and \(y=2x^2+3x-2\) are continuous, so we only need to see if the function is continuous at \(x=1.\)

(i)Since \(f(1)=1,\) \(f(1)\) exists.

(ii)The left-hand and right-hand limits are\[\begin{align} \displaystyle{\lim_{x\rightarrow1^{-}}}f(x)&=\displaystyle{\lim_{x\rightarrow1^{-}}}(-x^3+x+1)=1\\ \displaystyle{\lim_{x\rightarrow1^{+}}}f(x)&=\displaystyle{\lim_{x\rightarrow1^{+}}}(2x^2+3x-2)=3, \end{align}\]

respectively. Since the left-hand limit and right-hand limit are not equal, \(\displaystyle{\lim_{x\rightarrow1}}f(x)\) does not exist, so the function \(f(x)\) is not continuous at \(x=1.\)

The graph of the function would look like the figure above. Observe that there is a "break" at \(x=1,\) which causes the discontinuity. \( _\square \)

## Is the function \(\displaystyle{f(x)=\begin{cases}-\cos x&(x<0)\\e^x-2&(x\geq0)\end{cases}}\) continuous for all \(x\in\mathbb{R}?\)

We know that the graphs of \(y=-\cos x\) and \(y=e^x-2\) are continuous, so we only need to see if the function is continuous at \(x=0.\)

(i)Since \(f(0)=e^0-2=-1,\) \(f(0)\) exists.

(ii)The left-hand and right-hand limits are\[\begin{align} \displaystyle{\lim_{x\rightarrow0^{-}}}f(x)=\displaystyle{\lim_{x\rightarrow0^{-}}}(-\cos x)&=-1\\ \displaystyle{\lim_{x\rightarrow0^{+}}}f(x)=\displaystyle{\lim_{x\rightarrow0^{+}}}(e^x-2)&=-1, \end{align}\]

respectively. Therefore, \(\displaystyle{\lim_{x\rightarrow0^{-}}}f(x)=\displaystyle{\lim_{x\rightarrow0^{+}}}f(x)=\displaystyle{\lim_{x\rightarrow0}}f(x)=-1.\)

(iii)Now from (i) and (ii), we have \(\displaystyle{\lim_{x\rightarrow2}}f(x)= f(2)=-1,\) so the function is continuous at \(x=0.\) \( _\square \)

## Intermediate Value Theorem

Main Article: Intermediate Value Theorem

## Extreme Value Theorem

Main Article: Extreme Value Theorem

## Uniform Continuity

Uniform continuity is a stronger notion of continuity. Note that in the definition for continuity on an interval \(I,\) we say, "\(f\) must be continuous for all \(x_0 \in I,\)" which means for all \(x_0 \in I\) and for some given \(\varepsilon > 0\) we must be able to pick \(\delta > 0\) such that \(|x-x_0|<\delta\) implies \(\big|f(x)-f(x_0)\big| < \varepsilon\). However, note that for \(x_1,x_2 \in I\) the \(\delta_{x_1}\) we pick for \(x=x_1\) may be different from the \(\delta_{x_2}\) we pick for \(x=x_2\). Uniform continuity allows us to pick one \(\delta\) for all \(x,y \in I\), which is what makes the notion of uniform continuity stronger than continuity on an interval. We formally define uniform continuity as follows:

Let \(I \subset R\). A function \(f:I \rightarrow R\) is uniformly continuous on \(I\) if

\(\quad\)

(i)for all \(\varepsilon > 0\), there exists \(\delta>0\) such that for all \(x,y \in I, |x-y|<\delta\) implies \(\big|f(x)-f(y)\big|<\varepsilon;\)\(\quad\)

(ii)\(\forall \varepsilon>0,\exists \delta > 0,\forall x,y \in I, |x-y|<\delta \implies \big|f(x)-f(y)\big|<\varepsilon.\)

In other words, a function \(f\) is uniformly continuous if \(\delta\) is chosen independently of any specific point. This stronger notion of continuity has some extremely powerful results which we will examine further, but first an example. Let's show that \(f(x)=x^2\) is uniformly continuous on \([-2,3]\).

Let \(\varepsilon > 0\) and we now seek some \(\delta > 0\) such that for all \(x,y \in [-2,3]\) if \(|x-y|< \delta\) we have \(\big|f(x)-f(y)|<\varepsilon\). Consider the following inequality noting we are on \([-2,3]:\) \[\big|f(x)-f(y)\big|=\big|x^2-y^2\big| = |x-y||x+y| \leq 9|x-y|.\] So it appears that picking \(\delta = \frac{\varepsilon}{9}\) may be a good idea! Lets see. Define \(\delta = \frac{\varepsilon}{9}\) and then assume \(|x-y|< \delta,\) and we have \[\big|f(x)-f(y)\big|=\big|x^2-y^2\big| = |x-y||x+y| \leq 9|x-y|<9\delta=9\frac{\varepsilon}{9}=\varepsilon.\] Hence \(f(x)=x^2\) is uniformly continuous on \([-2,3].\ _\square\)

Upon first observation, continuity and uniform continuity seem fairly similar. In fact, their definitions appear to be almost the same aside from what we consider when we pick \(\delta;\) we will see however this makes a world of difference. Below we have the two formal definitions of continuity and uniform continuity respectively:

Continuityon \(I:\)For all \(\varepsilon > 0\), there exists \(\delta>0\), where for all \(y \in I, |x-y|<\delta\) implies \(\big|f(x)-f(y)\big|<\varepsilon.\)

Uniform Continuityon \(I:\)For all \(\varepsilon > 0\), there exists \(\delta>0\), so for all \(x,y \in I, |x-y|<\delta\) implies \(\big|f(x)-f(y)\big|<\varepsilon.\)

We mentioned earlier that uniform continuity is a stronger notion than continuity; we now prove that in fact uniform continuity implies continuity.

If \(f\) is uniformly continuous on \(I \subset R,\) then \(f\) is continuous on \(I\).

Proof: Assume that \(f\) is uniformly continuous on \(I \subset R\), that is that on \(I\) we know for all \(\varepsilon > 0\), there exists \(\delta>0\) such that for all \(x,y \in I, |x-y|<\delta\) implies \(\big|f(x)-f(y)\big|<\varepsilon\). Let \(x_0 \in I\) and let \(\varepsilon > 0\), then we now seek \(\delta > 0\) such that \(|x-x_0|<\delta\) implies \(\big|f(x)-f(x_0)\big|<\varepsilon\). By assumption \(f\) is uniformly continuous and thus there exists \(\delta>0\), so for all \(x,y \in I, |x-y|<\delta\) implies \(\big|f(x)-f(y)\big|<\varepsilon\) and hence picking this \(\delta\) ensures that \(|x-x_0|<\delta\) implies \(\big|f(x)-f(x_0)\big|<\varepsilon\). Therefore, uniform continuity implies continuity. \(_\square\)

We now consider the converse. Does continuity imply uniform continuity? Let's see, assume that it is true that continuity implies uniform continuity. This means that for the function \(f(x)=\frac{1}{x}\) which is indeed continuous on \((0,\infty),\) we will have that \(f(x)=\frac{1}{x}\) is uniformly continuous on \((0,\infty)\). Let \(\varepsilon = 1\), and define two sequences \((x_n)_{n=1}^{\infty},(y_n)_{n=1}^{\infty} \subset R\), where \(x_n = \frac{1}{n}\) and \(y_n = \frac{1}{n^2}\) and note that \(\lim\limits_{n \rightarrow \infty} x_n=\lim\limits_{n\rightarrow \infty}y_n=0\). So we have \[\big|f(x_n)-f(y_n)\big|=\left|\frac{1}{\hspace{2mm} \frac{1}{n}\hspace{2mm} }-\frac{1}{\hspace{2mm} \frac{1}{n^2}\hspace{2mm} }\right|=\big|n-n^2\big|=\big|n^2-n\big|.\] We see that for \(n>2\) we have\(\big|f(x_n)-f(y_n)\big|>1,\) which contradicts our assumption that \(f\) is uniformly continuous. Therefore, we have that continuity does not imply uniform continuity.

However, not all hope is lost. We can add one condition to our continuous function \(f\) to have it be uniformly continuous: we need \(f\) to be continuous on a closed and bounded interval.

If \(f\) is continuous on \([a,b] \subset R,\) where \([a,b]\) is closed and bounded, then \(f\) is uniformly continuous on \([a,b]\).

Proof: We assume for a contradiction that \(f\) is continuous on \([a,b] \subset R,\) where \([a,b]\) is closed and bounded, and \(f\) isnotuniformly continuous on \([a,b]\), which implies that \(|x-y|<\delta\) but \(\big|f(x)-f(y)\big| \geq \varepsilon\). Let \(\varepsilon > 0,\) pick \(\delta_n = \frac{1}{n},\) and define \(x_{\delta_n}=x_n\) and \(y_{\delta_n}=y_n\). Note these sequences are bounded since they are in \([a,b]\) and hence by the Bolzano-Weierstrass theorem the sub-sequence \((x_{n_k})\) must converge to some \(\lim\limits_{k \rightarrow \infty} x_{n_k} = c \in [a,b]\). Further, we have \(|x_{n_k}-y_{n_k}|<\frac{1}{n_k},\) so by squeeze theorem \(\lim\limits_{k \rightarrow \infty} y_{n_k} = c\). By the continuity of \(f\) on \([a,b]\) we have that \(\lim\limits_{k \rightarrow \infty} f(x_{n_k}) = f(c) = \lim\limits_{k \rightarrow \infty} f(y_{n_k}), \) but then \(\lim\limits_{k \rightarrow \infty} f(x_{n_k})-f(y_{n_k})=0 \) and this contradicts \(\big|f(x_{n_k})-f(y_{n_k})\big| \geq \varepsilon,\) so our assumption that \(f\) was not uniformly continuous was flawed and hence we have that \(f\) is uniformly continuous on \([a,b]\). \(_\square\)

There is however an even stronger type of continuity called Lipschitz continuity. The definition is as follows:

Let \(I \subset R\) and \(f:I \rightarrow R\), then we say \(f\) is Lipschitz continuous if there exists \(k \in R,k>0\) such that for all \(x,y \in I\) we have \(\big|f(x)-f(y)\big|\leq k|x-y|\).

Keeping up with the trend of stronger notions of continuity implying weaker notions of continuity, we show that Lipschitz continuity implies uniform continuity.

If \(f\) is Lipshitz continuous on \([a,b] \subset R,\) then \(f\) is uniformly continuous on \([a,b]\).

Proof: Assume that \(f\) is Lipshitz continuous on \([a,b] \subset R\) and hence by definition there exists \(k \in R,k>0\) such that for all \(x,y \in I\) we have \(\big|f(x)-f(y)\big|\leq k|x-y|\). Let \(\varepsilon > 0\) and pick \(\delta = \frac{\varepsilon}{k}\). Then we have for all \(x,y \in [a,b]\) where \(|x-y|<\delta\) that \(\big|f(x)-f(y)\big|\leq k|x-y|<k\frac{\varepsilon}{k}=\varepsilon\) and hence \(f\) is uniformly continuous on \([a,b]\).

So why is this useful? For one thing, we can use the properties of uniform continuity to prove things about integrable functions.

Notation

- A partition of \([a,b]\) is an ordered list \(\{a = p_0<p_1<\dots<p_{k-1}<p_k = b\},\) where for \(0 \leq i \leq k,\, p_i \in [a,b].\)
- \(||P||\) is the norm of the partition.
- \(U(f,P)\) refers to the upper sum defined as \(U(f,P)=\sum_{k=1}^{n} \sup\big\{ f(x):x \in [p_{k-1},p_k] \big\}(p_k-p_{k-1});\) we say \(M_k=\sup\big\{ f(x):x \in [p_{k-1},p_k] \big\}.\)
- \(L(f,P)\) refers to the lower sum defined as \(L(f,P)=\sum_{k=1}^{n} \inf\big\{ f(x):x \in [p_{k-1},p_k] \big\}(p_k-p_{k-1});\) we say \(m_k=\inf\big\{ f(x):x \in [p_{k-1},p_k] \big\}.\)

Let \([a,b] \subset R\) and \(f:[a,b] \rightarrow R\), then we say \(f\) is Riemann integrable on \([a,b]\) if for all \(\varepsilon > 0\), there exists a partition \(P\) of \([a,b]\) such that \(U(f,P)-L(f,P) < \varepsilon\).

If \(f\) is continuous on \([a,b] \subset R,\) then \(f\) is Riemann integrable on \([a,b]\).

Proof: Assume \(f\) is continuous on \([a,b] \subset R\). We now show that for all \(\varepsilon>0\) we can make \(U(f,P)\) and \(L(f,P)\) within \(\varepsilon\) of each other, that is, \(U(f,P)-L(f,P)<\varepsilon\). Let \(\varepsilon>0\) and note that since \(f\) is continuous, by the previous theorem \(f\) is uniformly continuous on \([a,b]\) and thus there exists \(\delta>0\) such that for all \(x,y \in [a,b]\) implies \(\big|f(x)-f(y)\big|<\frac{\varepsilon}{b-a}\), so we pick our partition such that \(||P|| < \delta\). So we have \[U(f,P)-L(f,P)=\sum_{k=1}^{n} M_k(p_k-p_{k-1})-\sum_{k=1}^{n} m_k(p_k-p_{k-1})=\sum_{k=1}^{n} (M_k-m_k)(p_k-p_{k-1}).\] Note since \(f\) is continuous we know there exists \(c_k,d_k \in [p_{k-1},p_k],0 \leq i \leq n, f(c_k)=M_k,f(d_k)=m_k,\) so we have \[U(f,P)-L(f,P)=\sum_{k=1}^{n} \big(f(c_k)-f(d_k)\big)(p_k-p_{k-1}).\] Since \(||P|| < \delta\), \[U(f,P)-L(f,P)=\sum_{k=1}^{n} \delta(p_k-p_{k-1})<\sum_{k=1}^{n} \frac{\varepsilon}{b-a}(p_k-p_{k-1})=\frac{\varepsilon}{b-a}\sum_{k=1}^{n} (p_k-p_{k-1})=\frac{\varepsilon}{b-a}(b-a)=\varepsilon.\] Note the last step where we said \(\sum_{k=1}^{n} (p_k-p_{k-1})=b-a\) uses the telescoping sum property. Therefore, we have that if \(f\) is continuous on \([a,b] \subset R,\) then \(f\) is Riemann integrable on \([a,b]\). \(_\square\)

**Cite as:**Continuous Functions.

*Brilliant.org*. Retrieved from https://brilliant.org/wiki/continuous-functions/