### 3. Continuity

Table of Content

In this section we define a limit of a function $$f\colon S\to \mathbb{R}$$ at a point $$x_0$$. It is assumed that the reader is already familiar with limit of a sequence, the real line and the general concept of a function of one real variable.

### Limit of a function

For a subset of real numbers, denoted by $$S$$, assume that $$x_0$$ is such point that there is a sequence of points $$(x_k)\in S$$ such that $$x_k\to x_0$$ as $$k\to \infty$$. Here the set $$S$$ is often the set of all real numbers, but sometimes an interval (open or closed).

##### Example 1.

Note that it is not necessary for $$x_0$$ to be in $$S$$. For example, the sequence $$x_k = 1/k\to 0$$ as $$k\to \infty$$ in $$S=]0,2[$$, and $$x_k\in S$$ for all $$k=1,2,\ldots$$ but $$0$$ is not in $$S$$.

### Limit of a function

We consider a function $$f$$ defined in the set $$S$$. Then we define the limit of the function $$f\colon S\to \mathbb{R}$$ at $$x_0$$ as follows.

##### Definition 1: Limit of a function

Suppose that $$S\subset \mathbb{R}$$ and $$f\colon S\to \mathbb{R}$$ is a function. Then we say that $$f$$ has a limit $$y_{0}$$ at $$x_{0}$$, and write $\lim_{x \to x_{0}}f(x)=y_{0},$ if, $$f(x_{k})\to y_{0}$$ as $$k\to \infty$$ for every sequence $$(x_{k})$$ in $$S\setminus\{x_0\}$$, such that $$x_{k}\to x_{0}$$ as $$k\to \infty$$.

##### Example 2.

The function $$f\colon \mathbb{R} \to \mathbb{R}$$ defined by $$f(x)=x^2$$ has a limit $$0$$ at the point $$x=0$$.

Function $$y=x^2$$.

##### Example 3.

The function $$g\colon\mathbb{R}\to \mathbb{R}$$ defined by $g(x)= \left\{\begin{array}{rl}0 & \text{ for }x<0, \\ 1 & \text{ for }x\ge 0.\end{array}\right.$ does not have a limit at the point $$x=0$$. To formally prove this, take sequences $$(x_k)$$, $$(y_k)$$ defined by $$x_k=1/k$$ and $$y_k=-1/k$$ for $$k=1,2,\ldots$$. Then the both sequences are in $$S=\mathbb{R}$$, but $$f(x_k)=1$$ and $$f(y_k)=0$$ for any $$k$$.

##### Example 4.

The function $$f(x)=x \sin(1/x)$$, $$x>0$$ does have the limit $$0$$ at $$0$$.

##### Example 5.

The function $$g(x)= \sin(1/x)$$, $$x>0$$ does not have a limit at $$0$$.

### One-sided limits

An important property of limits is that they are always unique. That is, if $$\lim_{x\to x_0} f(x)=a$$ and $$\lim_{x\to x_0} f(x)=b$$, then $$a=b$$. Although a function may have only one limit at a given point, it is sometimes useful to study the behavior of the function when $$x_k$$ approaches the point $$x_0$$ from the left or the right side. These limits are called the left and the right limit of the function $$f$$ at $$x_0$$, respectively.

##### Definition 2: One-sided limits

Suppose $$S$$ is a set in $$\mathbb{R}$$ and $$f$$ is a function defined on the set $$S\setminus\{x_0\}$$. Then we say that $$f$$ has a left limit $$y_{0}$$ at $$x_{0}$$, and write $\lim_{x \to x_{0}-}f(x)=y_{0},$ if, $$f(x_{k})\to y_{0}$$ as $$k\to \infty$$ for every sequence $$(x_{k})$$ in the set $$S\cap ]-\infty,x_0[ =\{ x\in S : x < x_0 \}$$, such that $$x_{k}\to x_{0}$$ as $$k\to \infty$$.

Similarly, we say that $$f$$ has a right limit $$y_{0}$$ at $$x_{0}$$, and write $\lim_{x \to x_{0}+}f(x)=y_{0},$ if, $$f(x_{k})\to y_{0}$$ as $$k\to \infty$$ for every sequence $$(x_{k})$$ in the set $$S\cap ]x_0,\infty[ =\{ x\in S : x_0 < x \}$$, such that $$x_{k}\to x_{0}$$ as $$k\to \infty$$.

##### Theorem 1: Limit of a function

A function $$f\colon S\to \mathbb{R}$$ has a limit $$y_0$$ at the point $$x_0$$ if and only if $\lim_{x \to x_{0}-}f(x)= \lim_{x \to x_{0}+}f(x)=y_{0}.$

##### Example 6.

The sign function $\mathrm{sgn}(x)= \frac{x}{|x|}$ is defined on $$S= \mathbb{R}\setminus 0$$. Its left and right limits at $$0$$ are $\lim_{x\to 0-} \mathrm{sgn}(x)= -1,\qquad \lim_{x\to 0+} \mathrm{sgn}(x)= 1.$ However, the function $$\mathrm{sgn}(x)$$ does not have a limit at $$0$$.

##### Example 7.

Function $$f: \mathbb{R}\setminus 0 \to \mathbb{R}$$ $f(x) = \frac{1}{x}$ does not have one-sided limits at 0.

### Limit rules

The following limit rules are immediately obtained from the definition and basic algebra of real numbers.

##### Theorem 2: Limit rules

Let $$c\in \mathbb{R}, \lim_{x\to x_{0}} f(x)=a$$ and $$\lim_{x\to x_{0}} g(x)=b.$$ Then

1. $$\lim_{x\to x_{0}} (cf)(x)=ca$$,
2. $$\lim_{x\to x_{0}} (f+g)(x)=a+b$$,
3. $$\lim_{x\to x_{0}} (fg)(x)=ab$$,
4. $$\lim_{x\to x_{0}} (f/g)(x)=a/b \ (\text{if} \ b \neq 0)$$.
##### Example 8.

Finding limits by calculating $$f(x_0)$$:

a) $\lim_{x\to 2}(5x-3)=10-3=7.$

b) $\lim_{x\to -2}\frac{3x+2}{x+5} = \frac{-6+2}{-2+5}=-\frac{4}{3}.$

c) $\lim_{x\to 2} \frac{x^2-4}{x-2} = \lim_{x\to 2} \frac{(x+2)(x-2)}{x-2} = \lim_{x\to 2}(x+2) = 4.$

### Limits and continuity

In this section, we define continuity of the function. The intutive idea behind continuity is that the graph of a continuous function is a connected curve. However, this is not sufficient as a mathematical definition for several reasons. For example, by using this definition, one cannot easily decide if $$\tan(x)$$ is a continuous function or not.

For continuity of a function $$f$$ at a given point $$x_0$$, it is required that:

1. $$f(x_0)$$ is defined,

2. $$\lim_{x \to x_0} f(x)$$ exists (and is finite),

3. $$\lim_{x \to x_0} f(x) = f(x_0)$$.

In other words:

##### Definition 2: Continuity

A function $$f\colon S\to \mathbb{R}$$ is continuous at a point $$x_{0}\in S$$, if $\lim_{x\to x_{0}}f(x)=f(x_{0}).$ A function $$f\colon S\to \mathbb{R}$$ is continuous, if it is continuous at every point $$x_{0}\in S$$.

##### Example 1.

Let $$c\in \mathbb{R}$$. Functions $$f,g,h$$ defined by $$f(x)=c$$, $$g(x)=x$$, $$h(x)=|x|$$ are continuous at every point $$x\in \mathbb{R}$$.

Why? If $$x_{k}\to x_{0}$$, then $$f(x_{k})=c$$ and $$\lim_{k\to \infty}f(x_k)= c=f(x_{0})$$. For $$g$$, we have $$g(x_{k})=x_{k}$$ and hence, $$\lim_{k\to\infty} g(x_k)=x_{0}=g(x_{0})$$. Similarly, $$h(x_{k})=|x_{k}|$$ and $$\lim_{k\to\infty}h(x_k)= |x_{0}|=h(x_{0})$$.

##### Example 2.

Let $$x_{0}\in \mathbb{R}$$. We define a function $$f\colon\mathbb{R}\to \mathbb{R}$$ by $f(x)= \left\{\begin{array}{rl}2 & \text{ for }x \lt x_{0}, \\ 3 & \text{ for }x\geq x_{0}.\end{array}\right.$ Then $\lim_{x \to x_{0}^{-}}f(x)=2,\text{ and } \lim_{x \to x_{0}^{+}}f(x)=3.$ Therefore $$f$$ is not continuous at the point $$x_{0}$$.

Some basic properties of continuous functions of one real variable are given next. From the limit rules (Theorem 2) we obtain:

##### Theorem 3.

The sum, the product and the difference of continuous functions are continuous. Then, in particular, polynomials are continuous functions. If $$f$$ and $$g$$ are polynomials and $$g(x_{0})\neq 0$$, then $$f/g$$ is continuous at a point $$x_{0}$$.

A composition of continuous functions is continuous if it is defined:

##### Theorem 4.

Let $$f\colon \mathbb{R}\to\mathbb{R}$$ and $$g\colon \mathbb{R}\to \mathbb{R}$$. Suppose that $$f$$ is continuous at a point $$x_{0}$$ and $$g$$ is continuous at $$f(x_{0})$$. Then $$g\circ f\colon \mathbb{R}\to \mathbb{R}$$ is continuous at a point $$x_{0}$$.

Proof.

Note. If $$f$$ is continuous, then $$|f|$$ is continuous.

Why?

Write $$g(x):=|x|$$. Then $$(g\circ f)(x)=|f(x)|$$.

Note. If $$f$$ and $$g$$ are continuous, then $$\max (f,g)$$ and $$\min (f,g)$$ are continuous. (Here $$\max (f,g)(x):=\max \{f(x),g(x)\}$$.)

Why?

Write $\begin{cases}(a+b)+|a-b|=2\max(a,b), \\ (a+b)-|a-b|=2\min(a,b). \end{cases}$

### Delta-epsilon definition

The so-called $$(\varepsilon,\delta)$$-definition for continuity is given next. The basic idea behind this test is that, for a function $$f$$ continuous at $$x_0$$, the values of $$f(x)$$ should get closer to $$f(x_0)$$ as $$x$$ gets closer to $$x_0$$.

This is the standard definition of continuity in mathematics, because it also works for more general classes of functions than ones on this course, but it not used in high-school mathematics. This important definition will be studied in-depth in Analysis 1 / Mathematics 1.

$$(\varepsilon,\delta)$$-test:

##### Theorem 5: $$(\varepsilon,\delta)$$-definition

Let $$f: S\to \mathbb{R}$$. Then the following conditions are equivalent:

1. $$\lim_{x\to x_0} f(x)= y_0$$,
2. For all $$\varepsilon> 0$$ there exists $$\delta >0$$ such that if $$0 < |x-x_0| < \delta$$, then $$|f(x) - y_0| <\varepsilon$$ for all $$x\in S$$.

Proof.

##### Example 3.

From Theorem 3 we already know that the function $$f: \mathbb{R} \to \mathbb{R}$$ defined by $$f(x) = 4x$$ is continuous. We can also use the $$(\varepsilon,\delta)$$-definition to prove this.

Proof. Let $$x_0 \in \mathbb{R}$$ and $$\varepsilon > 0$$. Now $|f(x) - f(x_0)| = |4x - 4x_0| = 4|x - x_0| < \varepsilon,$ when $|x - x_0| < \delta \text{, where } \delta = \frac{\varepsilon}{4}.$

So for all $$\varepsilon > 0$$ there exists $$\delta > 0$$ such that if $$|x - x_0| < \delta$$, then $$|f(x) - f(x_0)| < \varepsilon$$ for all $$x \in \mathbb{R}$$. Thus by Theorem 5 $$\lim_{x \to x_0} f(x) = f(x_0)$$ for all $$x_0 \in \mathbb{R}$$ and by definition this means that the function $$f: \mathbb{R} \to \mathbb{R}$$ is continuous.
$$\square$$

Interactivity. $$(\varepsilon, \delta)$$ in example 3.

##### Example 4.

Let $$x_{0}\in \mathbb{R}$$. We define a function $$f\colon\mathbb{R}\to \mathbb{R}$$ by $f(x)= \left\{\begin{array}{rl}2 & \text{ for }x \lt x_{0}, \\ 3 & \text{ for }x \geq x_{0}.\end{array}\right.$ In Example 2 we saw that this function is not continuous at the point $$x_0$$. To prove this using the $$(\varepsilon,\delta)$$-test, we need to find some $$\varepsilon > 0$$ and some $$x_\delta \in \mathbb{R}$$ such that for all $$\delta > 0$$, $$|x_\delta - x_0| < \delta$$, but $$|f(x_\delta) - f(x_0)| > \varepsilon$$.

Proof. Let $$\delta > 0$$ and $$\varepsilon = 1/2$$. By choosing $$x_\delta = x_0 - \delta /2$$, we have $0 < |x_\delta-x_0| = |x_0 - \frac{\delta}{2} + x_0| = \frac{\delta}{2} < \delta,$ and $|f(x_\delta) - f(x_0)| = |2 - 3| = 1 > \varepsilon.$ Therefore by Theorem 5 $$f$$ is not continuous at the point $$x_{0}$$.
$$\square$$

Interactivity. $$(\varepsilon, \delta)$$ in example 4.

### Properties of continuous functions

This section contains some fundamental properties of continuous functions. We start with the Intermediate Value Theorem for continuous functions, also known as Bolzano's Theorem. This theorem states that a function that is continuous on a given (closed) real interval, attains all values between its values at endpoints of the interval. Intuitively, this follows from the fact that the graph of a function defined on a real interval is a continuous curve.

##### Theorem 6: Intermediate Value Theorem

If $$f\colon [a,b]\to \mathbb{R}$$ is continuous and $$f(a) \lt s \lt f(b)$$, then there is at least one $$c\in ]a,b[$$ such that $$f(c)=s$$.

Proof.

Interactivity. Theorem 6.
##### Example 1.

Let function $$f:\mathbb{R} \to \mathbb{R}$$, where $f(x) = x^5 - 3x - 1.$ Show that there is at least one $$c \in \mathbb{R}$$ such that $$f(c) = 0$$.

Solution. As a polynomial function, $$f$$ is continuous. And because $f(1) = 1^5 - 3 \cdot 1 - 1 = -3 < 0$ and $f(-1) = (-1)^5 - 3 \cdot (-1) - 1 = 1 > 0,$ by the Intermediate Value Theorem there is at least one $$c \in ]-1, 1[$$ such that $$f(c) = 0$$.

##### Example 2.

Let $$f(x)=x^3-x=x(x^2-1)=x(x-1)(x-1)$$.

By the Intermediate Value Theorem we have $$f(x)<0$$ for $$x<-1$$ or $$0 \lt x \lt 1$$. Similarly, $$f(x)>0$$ for $$-1 \lt x \lt 0$$ or $$1 \lt x$$, because:

1. $$f(x)=0$$ if and only if $$x=0$$ or $$x=\pm 1$$, and
2. $$f(-2)<0, f(-1/2)>0, f(1/2)<0$$ and $$f(2)>0$$.

Next we prove that a continuous function defined on a closed real interval is necessarily bounded. For this result, it is important that the interval is closed. A counter example for an open interval is given after the next theorem.

##### Theorem 7.

Let $$f\colon [a,b]\to \mathbb{R}$$ be continuous. Then $$f$$ is bounded.

Proof.

Note. If $$f\colon ]a,b[\to \mathbb{R}$$ is continuous, it can be unbounded.

##### Example 4.

Let $$f\colon ]0,1]\to \mathbb{R}$$, where $$f(x)=1/x$$. Now $\lim_{x\to 0+}f(x)=\infty.$

##### Theorem 8.

Let $$f\colon [a,b]\to \mathbb{R}$$ be continuous. Then there exist points $$c,d\in [a,b]$$ such that $$f(c)\leq f(x)\leq f(d)$$ for all $$x\in [a,b]$$, i.e. $$f(c)$$ is minimum and $$f(d)$$ is maximum of $$f$$ on the interval $$[a,b]$$.

Proof.

##### Example 5.

Let $$f:[-1,2] \to \mathbb{R}$$, where $f(x) = -x^3 - x + 3.$ The domain of the function is $$[-1,2]$$. To determine the range of the function, we first notice that the function is decreasing. We will now show this.

Let $$x_1 < x_2$$. Then $x_{1}^3 < x_{2}^3$ and $-x_{1}^3 > -x_{2}^3.$

Because $$x_1 < x_2$$, $-x_1^3-x_1 > -x_2^3 -x_2$ and $-x_1^3-x_1 +3 > -x_2^3 -x_2 +3.$ Thus, if $$x_1 < x_2$$ then $$f(x_1) > f(x_2)$$, which means that the function $$f$$ is decreasing.

We know that a decreasing function has its minimum value in the right endpoint of the interval. Thus, the minimum value of $$f:[-1,2] \to \mathbb{R}$$ is $f(2) = -2^3 - 2 + 3 = -7.$ Respectively, a decreasing function has it's maximum value in the left endpoint of the interval and so the maximum value of $$f:[-1,2] \to \mathbb{R}$$ is $f(-1) = -(-1)^3 - (-1) + 3 = 5.$

As a polynomial function, $$f$$ is continuous and it therefore has all the values between it's minimum and maximum values. Hence, the range of $$f$$ is $$[-7, 5]$$.

##### Example 6.

Suppose that $$f$$ is a polynomial. Then $$f$$ is continuous on $$\mathbb{R}$$ and, by Theorem 7, $$f$$ is bounded on every closed interval $$[a,b]$$, $$a \lt b$$. Furthermore, by Theorem 3, $$f$$ must have minimum and maximum values on $$[a,b]$$.

Note. Theorem 8 is connected to the Intermediate Value Theorem in the following way:

If $$f\colon [a,b]\to \mathbb{R}$$ be continuous, then there exist points $$x_1,x_2\in [a,b]$$ such that $$f([a,b])=[f(x_1),f(x_2)]$$.