
# 5.4: Continuous Functions


## 5.4.1 Continuity at a Point

##### Definition

Suppose $$D \subset \mathbb{R}, f: D \rightarrow \mathbb{R},$$ and $$a \in D .$$ We say $$f$$ is continuous at $$a$$ if either $$a$$ is an isolated point of $$D$$ or $$\lim _{x \rightarrow a} f(x)=f(a) .$$ If $$f$$ is not continuous at $$a,$$ we say $$f$$ is discontinuous at $$a,$$ or that $$f$$ has a discontinuity at $$a .$$

##### Example $$\PageIndex{1}$$

Define $$f: \mathbb{R} \rightarrow \mathbb{R}$$ by

$f(x)=\left\{\begin{array}{ll}{1,} & {\text { if } x \text { is rational, }} \\ {0,} & {\text { if } x \text { is irrational. }}\end{array}\right.$

Then, by Example $$5.1 .5, f$$ is discontinuous at every $$x \in \mathbb{R}$$.

##### Example $$\PageIndex{2}$$

Define $$f: \mathbb{R} \rightarrow \mathbb{R}$$ by

$f(x)=\left\{\begin{array}{ll}{x,} & {\text { if } x \text { is rational, }} \\ {0,} & {\text { if } x \text { is irrational. }}\end{array}\right.$

Then, by Example 5.1 .6 and Exercise $$5.1 .10, f$$ is continuous at $$0,$$ but discontinuous at every $$x \neq 0 .$$

If $$D \subset \mathbb{R}, \alpha \in \mathbb{R}, f: D \rightarrow \mathbb{R},$$ and $$g: D \rightarrow \mathbb{R},$$ then we define $$\alpha f: D \rightarrow \mathbb{R}$$ by

$(\alpha f)(x)=\alpha f(x),$

$$f+g: D \rightarrow \mathbb{R} \mathrm{by}$$

$(f+g)(x)=f(x)+g(x),$

and $$f g: D \rightarrow \mathbb{R}$$ by

$(f g)(x)=f(x) g(x).$

Moreover, if $$g(x) \neq 0$$ for all $$x \in D,$$ we define $$\frac{f}{g}: D \rightarrow \mathbb{R}$$ by

$\left(\frac{f}{g}\right)(x)=\frac{f(x)}{g(x)}.$

##### Proposition $$\PageIndex{1}$$

Suppose $$D \subset \mathbb{R}, \alpha \in \mathbb{R}, f: D \rightarrow \mathbb{R},$$ and $$g: D \rightarrow \mathbb{R} .$$ If $$f$$ and $$g$$ are continuous at $$a,$$ then $$\alpha f, f+g,$$ and $$f g$$ are all continuous at $$a .$$ Moreover, if $$g(x) \neq 0$$ for all $$x \in D,$$ then $$\frac{f}{g}$$ is continuous at $$a .$$

##### Exercise $$\PageIndex{1}$$

Prove the previous proposition.

##### Proposition $$\PageIndex{2}$$

Suppose $$D \subset \mathbb{R}, f: D \rightarrow \mathbb{R}, f(x) \geq 0$$ for all $$x \in D,$$ and $$f$$ is continuous at $$a \in D .$$ If $$g: D \rightarrow \mathbb{R}$$ is defined by $$g(x)=\sqrt{f(x)},$$ then $$g$$ is continuous at $$a .$$

##### Exercise $$\PageIndex{2}$$

Prove the previous proposition.

##### Proposition $$\PageIndex{3}$$

Suppose $$D \subset \mathbb{R}, f: D \rightarrow \mathbb{R},$$ and $$a \in D .$$ Then $$f$$ is continuous at $$a$$ if and only if for every $$\epsilon>0$$ there exists $$\delta>0$$ such that

$|f(x)-f(a)|<\epsilon \text { whenever } x \in(a-\delta, a+\delta) \cap D.$

Proof

Suppose $$f$$ is continuous at $$a$$. If $$a$$ is an isolated point of $$D,$$ then there exists a $$\delta>0$$ such that

$(a-\delta, a+\delta) \cap D=\{a\}.$

Then for any $$\epsilon>0,$$ if $$x \in(a-\delta, a+\delta) \cap D,$$ then $$x=a,$$ and so

$|f(x)-f(a)|=|f(a)-f(a)|=0<\epsilon.$

If $$a$$ is a limit point of $$D,$$ then $$\lim _{x \rightarrow a} f(x)=f(a)$$ implies that for any $$\epsilon>0$$ there exists $$\delta>0$$ such that

$|f(x)-f(a)|<\epsilon \text { whenever } x \in(a-\delta, a+\delta) \cap D.$

Now suppose that for every $$\epsilon>0$$ there exists $$\delta>0$$ such that

$|f(x)-f(a)|<\epsilon \text { whenever } x \in(a-\delta, a+\delta) \cap D.$

If $$a$$ is an isolated point, then $$f$$ is continuous at $$a$$. If $$a$$ is a limit point, then this condition implies $$\lim _{x \rightarrow a} f(x)=f(a),$$ and so $$f$$ is continuous at $$a .$$ $$\quad$$ Q.E.D.

From the preceding, it should be clear that a function $$f: D \rightarrow \mathbb{R}$$ is continuous at a point $$a$$ of $$D$$ if and only if for every sequence $$\left\{x_{n}\right\}_{n \in I}$$ with $$x_{n} \in D$$ for every $$n \in I$$ and $$\lim _{n \rightarrow \infty} x_{n}=a, \lim _{n \rightarrow \infty} f\left(x_{n}\right)=f(a)$$.

##### Exercise $$\PageIndex{1}$$

Show that if $$f: D \rightarrow \mathbb{R}$$ is continuous at $$a \in D$$ and $$f(a)>0$$, then there exists an open interval $$I$$ such that $$a \in I$$ and $$f(x)>0$$ for every $$x \in I \cap D .$$

##### Proposition $$\PageIndex{4}$$

Suppose $$D \subset \mathbb{R}, E \subset \mathbb{R}, g: D \rightarrow \mathbb{R}, f: E \rightarrow \mathbb{R}, g(D) \subset E$$ and $$a \in D .$$ If $$g$$ is continuous at $$a$$ and $$f$$ is continuous at $$g(a),$$ then $$f \circ g$$ is continuous at $$a .$$

Proof

Let $$\left\{x_{n}\right\}_{n \in I}$$ be a sequence with $$x_{n} \in D$$ for every $$n \in I$$ and $$\lim _{n \rightarrow \infty} x_{n}=a$$. Then, since $$g$$ is continuous at $$a,\left\{g\left(x_{n}\right)\right\}_{n \in I}$$ is a sequence with $$g\left(x_{n}\right) \in E$$ for every $$n \in I$$ and $$\lim _{n \rightarrow \infty} g\left(x_{n}\right)=g(a) .$$ Hence, since $$f$$ is continuous at $$g(a),$$ $$\lim _{n \rightarrow \infty} f\left(g\left(x_{n}\right)\right)=f(g(a))$$. That is,

$\lim _{n \rightarrow \infty}(f \circ g)\left(x_{n}\right)=(f \circ g)(a).$

Hence $$f \circ g$$ is continuous at $$a$$.

##### Definition

Let $$D \subset \mathbb{R}, f: D \rightarrow \mathbb{R},$$ and $$a \in D .$$ If $$f$$ is not continuous at $$a$$ but both $$f(a-)$$ and $$f(a+)$$ exist, then we say $$f$$ has a simple discontinuity at $$a .$$

##### Proposition $$\PageIndex{5}$$

Suppose $$f$$ is monotonic on the interval $$(a, b) .$$ Then every discontinuity of $$f$$ in $$(a, b)$$ is a simple discontinuity. Moreover, if $$E$$ is the set of points in $$(a, b)$$ at which $$f$$ is discontinuous, then either $$E=\emptyset, E$$ is finite, or $$E$$ is countable.

Proof

The first statement follows immediately from Proposition 5.2.1. For the second statement, suppose $$f$$ is nondecreasing and suppose $$E$$ is nonempty. From Exercise 2.1 .26 and the the proof of Proposition $$5.2 .1,$$ it follows that for every $$x \in(a, b)$$,

$f(x-) \leq f(x) \leq f(x+).$

Hence $$x \in E$$ if and only if $$f(x-)<f(x+) .$$ Hence for every $$x \in E,$$ we may choose a rational number $$r_{x}$$ such that $$f(x-)<r_{x}<f(x+) .$$ Now if $$x, y \in E$$ with $$x<y,$$ then, by Proposition $$5.2 .2,$$

$r_{x}<f(x+) \leq f(y-)<r_{y},$

so $$r_{x} \neq r_{y}$$. Thus we have a one-to-one correspondence between $$E$$ and a subset of $$\mathbb{Q},$$ and so $$E$$ is either finite or countable. A similar argument holds if $$f$$ is nonincreasing. $$\quad$$ Q.E.D.

##### Exercise $$\PageIndex{4}$$

Define $$f: \mathbb{R} \rightarrow \mathbb{R}$$ by

$f(x)=\left\{\begin{array}{ll}{\frac{1}{q},} & {\text { if } x \text { is rational and } x=\frac{p}{q},} \\ {0,} & {\text { if } x \text { is irrational. }}\end{array}\right.$

where $$p$$ and $$q$$ are taken to be relatively prime integers with $$q>0,$$ and we take $$q=1$$ when $$x=0 .$$ Show that $$f$$ is continuous at every irrational number and has a simple discontinuity at every rational number.

### 5.4.2 Continuity on a Set

##### Definition

Suppose $$D \subset \mathbb{R}$$ and $$f: D \rightarrow \mathbb{R} .$$ We say $$f$$ is continuous on $$D$$ if $$f$$ is continuous at every point $$a \in D$$.

##### Proposition $$\PageIndex{6}$$

If $$f$$ is a polynomial, then $$f$$ is continuous on $$\mathbb{R}$$.

##### Proposition $$\PageIndex{7}$$

If $$D \subset \mathbb{R}$$ and $$f: D \rightarrow \mathbb{R}$$ is a rational function, then $$f$$ is continuous on $$D .$$

##### Exercise $$\PageIndex{5}$$

Explain why the function $$f(x)=\sqrt{1-x^{2}}$$ is continuous on $$[-1,1]$$.

##### Exercise $$\PageIndex{6}$$

Discuss the continuity of the function

$f(x)=\left\{\begin{array}{ll}{x+1,} & {\text { if } x<0,} \\ {4,} & {\text { if } x=0,} \\ {x^{2},} & {\text { if } x>0.}\end{array}\right.$

If $$D \subset \mathbb{R}, f: D \rightarrow \mathbb{R},$$ and $$E \subset \mathbb{R},$$ we let

$f^{-1}(E)=\{x: f(x) \in E\}.$

##### Proposition $$\PageIndex{8}$$

Suppose $$D \subset \mathbb{R}$$ and $$f: D \rightarrow \mathbb{R} .$$ Then $$f$$ is continuous on $$D$$ if and only if for every open set $$V \subset \mathbb{R}, f^{-1}(V)=U \cap D$$ for some open set $$U \subset \mathbb{R} .$$

Proof

Suppose $$f$$ is continuous on $$D$$ and $$V \subset \mathbb{R}$$ is an open set. If $$V \cap f(D)=\emptyset$$, then $$f^{-1}(V)=\emptyset,$$ which is open. So suppose $$V \cap f(D) \neq \emptyset$$ and let $$a \in f^{-1}(V)$$. Since $$V$$ is open and $$f(a) \in V,$$ there exists $$\epsilon_{a}>0$$ such that

$\left(f(a)-\epsilon_{a}, f(a)+\epsilon_{a}\right) \subset V.$

Since $$f$$ is continuous, there exists $$\delta_{a}>0$$ such that

$f\left(\left(a-\delta_{a}, a+\delta_{a}\right) \cap D\right) \subset\left(f(a)-\epsilon_{a}, f(a)+\epsilon_{a}\right) \subset V.$

That is, $$\left(a-\delta_{a}, a+\delta_{a}\right) \cap D \subset f^{-1}(V) .$$ Let

$U=\bigcup_{a \in f^{-1}(V)}\left(a-\delta_{a}, a+\delta_{a}\right).$

Then $$U$$ is open and $$f^{-1}(V)=U \cap D$$.

Now suppose that for every open set $$V \subset \mathbb{R}, f^{-1}(V)=U \cap D$$ for some open set $$U \subset \mathbb{R} .$$ Let $$a \in D$$ and let $$\epsilon>0$$ be given. Since $$(f(a)-\epsilon, f(a)+\epsilon)$$ is open, there exists an open set $$U$$ such that

$U \cap D=f^{-1}((f(a)-\epsilon, f(a)+\epsilon)).$

Since $$U$$ is open and $$a \in U,$$ there exists $$\delta>0$$ such that $$(a-\delta, a+\delta) \subset U .$$ But then

$f((a-\delta, a+\delta) \cap D) \subset(f(a)-\epsilon, f(a)+\epsilon).$

That is, if $$x \in(a-\delta, a+\delta) \cap D,$$ then $$|f(x)-f(a)|<\epsilon .$$ Hence $$f$$ is continuous at $$a .$$ $$\quad$$ Q.E.D.

##### Exercise $$\PageIndex{7}$$

Let $$D \subset \mathbb{R}$$ and $$f: D \rightarrow \mathbb{R} .$$ For any $$E \subset \mathbb{R},$$ show that $$f^{-1}(\mathbb{R} \backslash E)=\left(\mathbb{R} \backslash f^{-1}(E)\right) \cap D$$.

##### Exercise $$\PageIndex{8}$$

Let $$A$$ be a set and, for each $$\alpha \in A,$$ let $$U_{\alpha} \subset \mathbb{R} .$$ Given $$D \subset \mathbb{R}$$ and a function $$f: D \rightarrow \mathbb{R},$$ show that

$\bigcup_{\alpha \in A} f^{-1}\left(U_{\alpha}\right)=f^{-1}\left(\bigcup_{\alpha \in A} U_{\alpha}\right)$

and

$\bigcap_{\alpha \in A} f^{-1}\left(U_{\alpha}\right)=f^{-1}\left(\bigcap_{\alpha \in A} U_{\alpha}\right).$

##### Exercise $$\PageIndex{9}$$

Suppose $$D \subset \mathbb{R}$$ and $$f: D \rightarrow \mathbb{R} .$$ Show that $$f$$ is continuous on $$D$$ if and only if for every closed set $$C \subset \mathbb{R}, f^{-1}(C)=F \cap D$$ for some closed set $$F \subset \mathbb{R} .$$

##### Exercise $$\PageIndex{10}$$

Let $$D \subset \mathbb{R} .$$ We say a function $$f: D \rightarrow \mathbb{R}$$ is Lipschitz if there exists $$\alpha \in \mathbb{R}, \alpha>0,$$ such that $$|f(x)-f(y)| \leq \alpha|x-y|$$ for all $$x, y \in D .$$ Show that if $$f$$ is Lipschitz, then $$f$$ is continuous.

#### 5.4.3 Intermediate Value Theorem

##### Theorem $$\PageIndex{9}$$

(Intermediate Value Theorem).

Suppose $$a, b \in \mathbb{R}, a<b,$$ and $$f:[a, b] \rightarrow \mathbb{R} .$$ If $$f$$ is continuous and $$s \in \mathbb{R}$$ is such that either $$f(a) \leq s \leq f(b)$$ or $$f(b) \leq s \leq f(a),$$ then there exists $$c \in[a, b]$$ such that $$f(c)=s$$.

Proof

Suppose $$f(a)<f(b)$$ and $$f(a)<s<f(b) .$$ Let

$c=\sup \{x: x \in[a, b], f(x) \leq s\}.$

Suppose $$f(c)<s .$$ Then $$c<b$$ and, since $$f$$ is continuous at $$c,$$ there exists a $$\delta>0$$ such that $$f(x)<s$$ for all $$x \in(c, c+\delta) .$$ But then $$f\left(c+\frac{\delta}{2}\right)<s$$, contradicting the definition of $$c .$$ Similarly, if $$f(c)>s,$$ then $$c>a$$ and there exists $$\delta>0$$ such that $$f(x)>s$$ for all $$x \in(c-\delta, c),$$ again contradicting the definition of $$c .$$ Hence we must have $$f(c)=s .$$ $$\quad$$ Q.E.D.

##### Example $$\PageIndex{3}$$

Suppose $$a \in \mathbb{R}, a>0,$$ and consider $$f(x)=x^{n}-a$$ where $$n \in \mathbb{Z}, n>1 .$$ Then $$f(0)=-a<0$$ and

\begin{aligned} f(1+a) &=(1+a)^{n}-a \\ &=1+n a+\sum_{i=2}^{n}\left(\begin{array}{c}{n} \\ {i}\end{array}\right) a^{i}-a \\ &=1+(n-1) a+\sum_{i=2}^{n}\left(\begin{array}{c}{n} \\ {i}\end{array}\right) a^{i}>0, \end{aligned}

where $$\left(\begin{array}{l}{n} \\ {i}\end{array}\right)$$ is the binomial coefficient

$\left(\begin{array}{l}{n} \\ {i}\end{array}\right)=\frac{n !}{i !(n-i) !}.$

Hence, by the Intermediate Value Theorem, there exists a real number $$\gamma>0$$ such that $$\gamma^{n}=a .$$ Moreover, there is only one such $$\gamma$$ since $$f$$ is increasing on $$(0,+\infty) .$$

We call $$\gamma$$ the $$n$$ th root of $$a,$$ and write

$\gamma=\sqrt[n]{a}$

or

$\gamma=a^{\frac{1}{n}}.$

Moreover, if $$a \in \mathbb{R}, a<0, n \in Z^{+}$$ is odd, and $$\gamma$$ is the nth root of $$-a,$$ then

$(-\gamma)^{n}=(-1)^{n}(\gamma)^{n}=(-1)(-a)=a.$

That is, $$-\gamma$$ is the $$n$$ th root of $$a$$.

##### Definition

If $$n=\frac{p}{q} \in \mathbb{Q}$$ with $$q \in \mathbb{Z}^{+},$$ then we define

$x^{n}=(\sqrt[q]{x})^{p}$

for all real $$x \geq 0$$.

##### Exercise $$\PageIndex{11}$$

Explain why the equation $$x^{5}+4 x^{2}-16=0$$ has a solution in the interval $$(0,2)$$.

##### Exercise $$\PageIndex{12}$$

Give an example of a closed interval $$[a, b] \subset \mathbb{R}$$ and a function $$f:[a, b] \rightarrow \mathbb{R}$$ which do not satisfy the conclusion of the Intermediate Value Theorem.

##### Exercise $$\PageIndex{13}$$

Show that if $$I \subset \mathbb{R}$$ is an interval and $$f: I \rightarrow \mathbb{R}$$ is continuous, then $$f(I)$$ is an interval.

##### Exercise $$\PageIndex{14}$$

Suppose $$f:(a, b) \rightarrow \mathbb{R}$$ is continuous and strictly monotonic. Let $$(c, d)=f((a, b)) .$$ Show that $$f^{-1}:(c, d) \rightarrow(a, b)$$ is strictly monotonic and continuous.

##### Exercise $$\PageIndex{15}$$

Let $$n \in \mathbb{Z}^{+} .$$ Show that the function $$f(x)=\sqrt[n]{x}$$ is continuous on $$(0,+\infty)$$.

##### Exercise $$\PageIndex{16}$$

Use the method of bisection to give another proof of the Intermediate Value Theorem.

##### Theorem $$\PageIndex{10}$$

Suppose $$D \subset \mathbb{R}$$ is compact and $$f: D \rightarrow \mathbb{R}$$ is continuous. Then $$f(D)$$ is compact.

Proof

Given a sequence $$\left\{y_{n}\right\}_{n \in I}$$ in $$f(D),$$ choose a sequence $$\left\{x_{n}\right\}_{n \in I}$$ such that $$f\left(x_{n}\right)=y_{n} .$$ Since $$D$$ is compact, $$\left\{x_{n}\right\}_{n \in I}$$ has a convergent subsequence $$\left\{x_{n_{k}}\right\}_{k=1}^{\infty}$$ with

$\lim _{k \rightarrow \infty} x_{n_{k}}=x \in D.$

Let $$y=f(x) .$$ Then $$y \in f(D)$$ and, since $$f$$ is continuous,

$y=\lim _{k \rightarrow \infty} f\left(x_{n_{k}}\right)=\lim _{k \rightarrow \infty} y_{n_{k}}.$

Hence $$f(D)$$ is compact.

##### Exercise $$\PageIndex{17}$$

Prove the previous theorem using the open cover definition of a compact set.

##### Theorem $$\PageIndex{11}$$

(Extreme Value Theorem).

Suppose $$D \subset \mathbb{R}$$ is compact and $$f: D \rightarrow \mathbb{R}$$ is continuous. Then there exists $$a \in D$$ such that $$f(a) \geq f(x)$$ for all $$x \in D$$ and there exists $$b \in D$$ such that $$f(b) \leq f(x)$$ for all $$x \in D .$$ $$\quad$$ Q.E.D.

As a consequence of the Extreme Value Theorem, a continuous function on a closed bounded interval attains both a maximum and a minimum value.

##### Exercise $$\PageIndex{18}$$

Find an example of a closed bounded interval $$[a, b]$$ and a function $$f:[a, b] \rightarrow \mathbb{R}$$ such that $$f$$ attains neither a maximum nor a minimum value on $$[a, b] .$$

##### Exercise $$\PageIndex{19}$$

Find an example of a bounded interval $$I$$ and a function $$f: I \rightarrow \mathbb{R}$$ which is continuous on $$I$$ such that $$f$$ attains neither a maximum nor a minimum value on $$I .$$

##### Exercise $$\PageIndex{20}$$

Suppose $$K \subset \mathbb{R}$$ is compact and $$a \notin K .$$ Show that there exists $$b \in K$$ such that $$|b-a| \leq|x-a|$$ for all $$x \in K$$.

##### Proposition $$\PageIndex{12}$$

Suppose $$D \subset \mathbb{R}$$ is compact, $$f: D \rightarrow \mathbb{R}$$ is continuous and one-to-one, and $$E=f(D) .$$ Then $$f^{-1}: E \rightarrow D$$ is continuous.

Proof

Let $$V \subset \mathbb{R}$$ be an open set. We need to show that $$f(V \cap D)=U \cap E$$ for some open set $$U \subset \mathbb{R}$$. Let $$C=D \cap(\mathbb{R} \backslash V) .$$ Then $$C$$ is a closed subset of $$D,$$ and so is compact. Hence $$f(C)$$ is a compact subset of $$E .$$ Thus $$f(C)$$ is closed, and so $$U=\mathbb{R} \backslash f(C)$$ is open. Moreover, $$U \cap E=E \backslash f(C)=f(V \cap D) .$$ Thus $$f^{-1}$$ is continuous.

##### Exercise $$\PageIndex{21}$$

Suppose $$f:[0,1] \cup(2,3] \rightarrow[0,2]$$ by

$f(x)=\left\{\begin{array}{ll}{x,} & {\text { if } 0 \leq x \leq 1,} \\ {x-1,} & {\text { if } 2<x \leq 3.}\end{array}\right.$

Show that $$f$$ is continuous, one-to-one, and onto, but that $$f^{-1}$$ is not continuous.

##### Definition

Suppose $$D \subset \mathbb{R}$$ and $$f: D \rightarrow \mathbb{R} .$$ We say $$f$$ is uniformly continuous on $$D$$ if for every $$\epsilon>0$$ there exists $$\delta>0$$ such that for any $$x, y \in D$$,

$|f(x)-f(y)|<\epsilon \text { whenever }|x-y|<\delta .$

##### Exercise $$\PageIndex{22}$$

Suppose $$D \subset \mathbb{R}$$ and $$f: D \rightarrow \mathbb{R}$$ is Lipschitz (see Exercise $$5.4 .10) .$$ Show that $$f$$ is uniformly continuous on $$D .$$

Clearly, if $$f$$ is uniformly continuous on $$D$$ then $$f$$ is continuous on $$D .$$ However, a continuous function need not be uniformly continuous.

##### Example $$\PageIndex{4}$$

Define $$f:(0,+\infty)$$ by $$f(x)=\frac{1}{x},$$ Given any $$\delta>0,$$ choose $$n \in \mathbb{Z}^{+}$$ such that $$\frac{1}{n(n+1)}<\delta .$$ Let $$x=\frac{1}{n}$$ and $$y=\frac{1}{n+1} .$$ Then

$|x-y|=\frac{1}{n}-\frac{1}{n+1}=\frac{1}{n(n+1)}<\delta .$

However,

$|f(x)-f(y)|=|n-(n+1)|=1.$

Hence, for example, there does not exist a $$\delta>0$$ such that

$|f(x)-f(y)|<\frac{1}{2}$

whenever $$|x-y|<\delta .$$ Thus $$f$$ is not uniformly continuous on $$(0,+\infty),$$ although $$f$$ is continuous on $$(0,+\infty)$$.

##### Example $$\PageIndex{5}$$

Define $$f: \mathbb{R} \rightarrow \mathbb{R}$$ by $$f(x)=2 x .$$ Let $$\epsilon>0$$ be given. If $$\delta=\frac{\varepsilon}{2}$$, then

$|f(x)-f(y)|=2|x-y|<\epsilon$

whenever $$|x-y|<\delta .$$ Hence $$f$$ is uniformly continuous on $$\mathbb{R}$$.

##### Exercise $$\PageIndex{23}$$

Let $$f(x)=x^{2} .$$ Show that $$f$$ is not uniformly continuous on $$(-\infty,+\infty)$$.

##### Proposition $$\PageIndex{13}$$

Suppose $$D \subset \mathbb{R}$$ is compact and $$f: D \rightarrow \mathbb{R}$$ is continuous. Then $$f$$ is uniformly continuous on $$D .$$

Proof

Let $$\epsilon>0$$ be given. For every $$x \in D,$$ choose $$\delta_{x}$$ such that

$|f(x)-f(y)|<\frac{\epsilon}{2}$

whenever $$y \in D$$ and $$|x-y|<\delta_{x} .$$ Let

$J_{x}=\left(x-\frac{\delta_{x}}{2}, x+\frac{\delta_{x}}{2}\right).$

Then $$\left\{J_{x}: x \in D\right\}$$ is an open cover of $$D$$. Since $$D$$ is compact, there must exist $$x_{1}, x_{2}, \ldots, x_{n}, n \in Z^{+},$$ such that $$J_{x_{1}}, J_{x_{2}}, \ldots, J_{x_{n}}$$ is an open cover of $$D .$$ Let $$\delta$$ be the smallest of

$\frac{\delta_{x_{1}}}{2}, \frac{\delta_{x_{2}}}{2}, \ldots, \frac{\delta_{x_{n}}}{2}.$

Now let $$x, y \in D$$ with $$|x-y|<\delta .$$ Then for some integer $$k, 1 \leq k \leq n, x \in J_{x_{k}},$$ that is,

$\left|x-x_{k}\right|<\frac{\delta_{x_{k}}}{2}.$

Moreover,

$\left|y-x_{k}\right| \leq|y-x|+\left|x-x_{k}\right|<\delta+\frac{\delta_{x_{k}}}{2} \leq \delta_{x_{k}}.$

Hence

$|f(x)-f(y)| \leq\left|f(x)-f\left(x_{k}\right)\right|+\left|f\left(x_{k}\right)-f(y)\right|<\frac{\epsilon}{2}+\frac{\epsilon}{2}=\epsilon .$

Q.E.D.

##### Exercise $$\PageIndex{24}$$

Suppose $$D \subset \mathbb{R}$$ and $$f: D \rightarrow \mathbb{R}$$ is uniformly continuous. Show that if $$\left\{x_{n}\right\}_{n \in I}$$ is a Cauchy sequence in $$D,$$ then $$\left\{f\left(x_{n}\right)\right\}_{n \in I}$$ is a Cauchy sequence in $$f(D) .$$

##### Exercise $$\PageIndex{25}$$

Suppose $$f:(0,1) \rightarrow \mathbb{R}$$ is uniformly continuous. Show that $$f(0+)$$ exists.

##### Exercise $$\PageIndex{26}$$

Suppose $$f: \mathbb{R} \rightarrow \mathbb{R}$$ is continuous and $$\lim _{x \rightarrow-\infty} f(x)=0$$ and $$\lim _{x \rightarrow+\infty} f(x)=0 .$$ Show that $$f$$ is uniformly continuous.