# Math for Non-Geeks/ Composition of continuous functions

Many functions are defined as the concatenation - the linking together of things, like in a chain - of other functions. Checking for continuity of such concatenated functions by using the classical epsilon-delta criterion for continuity is often tedious. However, one can prove that the concatenation of continuous functions is once again a continuous function. This is an important tool that simplifies the proof for continuity of compositions of functions.

## Concatenation Theorems

The concatenation theorems for continuous functions are the following:
Theorem (Concatenation Theorems)
Let $D\subseteq \mathbb {R}$ be a subset of the real numbers (domain of definition) and $\lambda \in \mathbb {R}$ be a real number. Let $f,g:D\to \mathbb {R}$ be real-valued functions, which are continuous at all $a\in D$ . That means, $\lim _{x\to a}{f(x)}=f(a)$ and $\lim _{x\to a}{g(x)}=g(a)$. Then, the following functions are continuous at $a$ , as well:
* $f+g:D\to \mathbb {R} :x\mapsto f(x)+g(x)$
* $\lambda f:D\to \mathbb {R} :x\mapsto \lambda \cdot f(x)$
* $fg:D\to \mathbb {R} :x\mapsto f(x)\cdot g(x)$
Let $D'=\{x\in D:g(x)\neq 0\}$ and consider $f$ and $g$ which are both continuous in $a\in D'$. Then, the following quotient function is continuous in $a$:
${\frac {f}{g}}:D'\to \mathbb {R} :x\mapsto {\frac {f(x)}{g(x)}}$
Let $h:E\to \mathbb {R}$ be a real-valued function with $f(D)\subseteq E$ , which is continuous at $b=f(a)\in E$ . Then, the concatenation $h\circ f$ is also continuous - namely at $a$:
$h\circ f:D\to \mathbb {R} :x\mapsto h(f(x))$

## Motivation

Imagine, we are given a function containing sums, products and quotients like $f:\mathbb {R} \to \mathbb {R} _{0}^{+}$, $x\mapsto \left|{\tfrac {1+x^{3}}{1+x^{2}}}\right|$ . We would like to know whether this function is continuous at some argument $a\in \mathbb {R}$ . So we consider any sequence of arguments $(x_{n})_{n\in \mathbb {N} }$ converging to $a$ and check whether there is always $\lim _{n\to \infty }f(x_{n})=f(a)$. For handling sums, products and quotients, the limit theorems for convergent sequences turn out to be very useful:
${\begin{aligned}\lim _{n\to \infty }f(x_{n})&=\lim _{n\rightarrow \infty }{\left|{\frac {1+x_{n}^{3}}{1+x_{n}^{2}}}\right|}\\[0.5em]&\quad {\color {Gray}\left\downarrow \ {\text{rule for absolute values}}\right.}\\[0.5em]&=\left|\lim _{n\to \infty }{\left({\frac {1+x_{n}^{3}}{1+x_{n}^{2}}}\right)}\right|\\[0.5em]&\quad {\color {Gray}\left\downarrow \ {\text{quotient, product and sum rule}}\right.}\\[0.5em]&=\left|{\frac {\lim _{n\to \infty }1+\left(\lim _{n\to \infty }x_{n}\right)^{3}}{\lim _{n\to \infty }1+\left(\lim _{n\to \infty }x_{n}\right)^{2}}}\right|\\[0.5em]&\quad {\color {Gray}\left\downarrow \ \lim _{n\to \infty }x_{n}=a\right.}\\[0.5em]&=\left|{\frac {1+a^{3}}{1+a^{2}}}\right|=f(a)\end{aligned}}$
Those formulas could be applied because all subsequences converge (we showed this in the end of our calculations). As $a\in \mathbb {R}$ was chosen to be arbitrary, we directly obtain the continuity of the entire function $f$ . This proof of continuity is basically an application of the sequence criterion plus theorems for sequence limits. Since, thanks to the limit theorems, the limit can be pulled into the function, we can use it to establish continuity. And the above concatenation theorems shorten proofs of this kind even further. we consider the following functions:
* $a:\mathbb {R} \to \mathbb {R} :x\mapsto x$
* $b:\mathbb {R} \to \mathbb {R} :x\mapsto 1$
* $c:\mathbb {R} \to \mathbb {R} ^{+}:x\mapsto |x|$
Now, $f$ may be written as a concatenation of those three functions:
$f(x)=c\left({\frac {b(x)+a(x)a(x)a(x)}{b(x)+a(x)a(x)}}\right)$
As all three functions $a$, $b$ and $c$ are continuous, the concatenation theorems will directly imply continuity for $f$ . This argumentation is even shorter than the proof using the sequence criterion. So the continuity proof can be concluded in one sentence: $f$ is continuous because it is a concatenation of continuous functions. And indeed, any concatenation constructed out of continuous functions (i.e. by combining polynomials) is continuous.

## Problem Example

The following problem illustrates just how easy it is to establish continuity of a function using the concatenation theorems:
Math for Non-Geeks: Template:Aufgabe

## General sketch of the proof

Following the concatenation theorems, every composition of continuous functions is again continuous function. So if $f:D\to \mathbb {R}$ can be written as a concatenation of continuous functions, we can directly infer continuity of $f$ . A corresponding proof could be of the following form:
In a lecture, this proof scheme may of course only be applied if the concatenation theorems have already been treated before. In any way, it is a very efficient method to characterize continuous functions.

## Corollary: Polynomial functions are continuous

Every polynomial function can be written as a concatenation of following the two functions:
* $f:\mathbb {R} \to \mathbb {R} :x\mapsto x$
* $g_{c}:\mathbb {R} \to \mathbb {R} :x\mapsto c$
$f$ is the identity $g_{c}$ the constant function with value $c$. These functions are continuous and hence, every polynomial function is continuous. For instance, we may construct the polynomial function $h:\mathbb {R} \to \mathbb {R} :x\mapsto 2x^{3}-4x+23$ out of $f$ and $g_{c}$ as follows:
$h(x)=g_{2}(x)\cdot f(x)\cdot f(x)\cdot f(x)+g_{-4}(x)\cdot f(x)+g_{23}(x)$
Explicitly, this decomposition reads:
${\begin{aligned}h(x)&=2x^{3}-4x+23\\&=2\cdot x\cdot x\cdot x+(-4)\cdot x+23\\&=g_{2}(x)\cdot f(x)\cdot f(x)\cdot f(x)+g_{-4}(x)\cdot f(x)+g_{23}(x)\end{aligned}}$

## Further examples

Exactly as subsequences have to converge for a concatenation sequence to converge, we need that our building brick functions are continuous in order to obtain a continuous concatenation function. When using non-continuous functions for the concatenation, we do not know anything about the continuity of the outcome. For instance:
${\begin{aligned}f:\mathbb {R} \to \mathbb {R} :x\mapsto &1\\g:\mathbb {R} \to \mathbb {R} :x\mapsto &{\begin{cases}1,&x\geq 0\\0,&x<0\end{cases}}\end{aligned}}$
The function $f$is continuous at $x=0$, whereas $g$ is not. The product of both functions is again $g$, since $f(x)\cdot g(x)=1\cdot g(x)=g(x)$. Therefore the product (i.e. a concatenation) is discontinuous at $x=0$. By contrast to what one may intuitively expect, concatenating discontinuous functions may also yield us a continuous function. To illustrate this, let us consider:
$h:\mathbb {R} \to \mathbb {R} :x\mapsto h(x)={\begin{cases}0,&x\in \mathbb {R} \setminus \mathbb {Q} \\1,&x\in \mathbb {Q} \end{cases}}$
This function maps rational numbers to $1$ an all other to $0$ . Concatenating $h$ with itself, we get the following function $h\circ h$:
${\begin{aligned}h(h(x))&={\begin{cases}0,&h(x)\in \mathbb {R} \setminus \mathbb {Q} \\1,&h(x)\in \mathbb {Q} \end{cases}}\\[0.3em]&\quad {\color {Gray}\left\downarrow \ h(x){\text{ is always rational.}}\right.}\\[0.3em]&=1\end{aligned}}$
$h\circ h$ is just a constant function. Hence it is continuous - although $h$ was actually nowhere continuous. So concatenating discontinuous functions may indeed yield us a continuous function.

## Proof of concatenation theorems
### Continuity under addition

Theorem (Concatenation theorem for sums)
Let $D\subseteq \mathbb {R}$ and let $f,g:D\to \mathbb {R}$ be real-valued functions, which are continuous in $a\in D$ Then, $f+g:D\to \mathbb {R} :x\mapsto f(x)+g(x)$ is continuous in $a$ , as well.
Proof (Concatenation theorem for sums)
We will prove the addition rule for continuity by checking the sequence criterion. Let $(x_{n})_{n\in \mathbb {N} }$ be any sequence of arguments taken from the domain $D$ and converging to $a$. There is:
${\begin{aligned}&\lim _{n\to \infty }(f+g)(x_{n})\\[0.3em]=&\lim _{n\to \infty }\left(f(x_{n})+g(x_{n})\right)\\[0.3em]&\quad {\color {Gray}\left\downarrow \ {\text{Limit theorem: addition rule}}\right.}\\[0.3em]=&\lim _{n\to \infty }f(x_{n})+\lim _{n\to \infty }g(x_{n})\\[0.3em]=&f(a)+g(a)=(f+g)(a)\end{aligned}}$
Alternative proof (Concatenation theorem for sums)
It is also possible to establish continuity of $f+g$ in $a$by checkng the Epsilon-Delta criterion . Let any $\epsilon >0$ be given. As $f$ is continuous at $a$ , there has to be a $\delta _{f}>0$, such that for all $x\in D$ with $|x-a|<\delta _{f}$ the inequality $|f(x)-f(a)|<\epsilon /2$ holds. Analogously for $g$, there is a $\delta _{g}>0$, such that for all $x\in D$ with $|x-a|<\delta _{g}$ the inequality $|g(x)-g(a)|<\epsilon /2$ holds.
Now, we set $\delta :=\min\{\delta _{f},\delta _{g}\}$. Hence, for all $x\in D$ with $|x-a|<\delta$ ,both the conditions $|f(x)-f(a)|<\epsilon /2$ and $|g(x)-g(a)|<\epsilon /2$ are fulfilled. Thus, for all $x$ with $|x-a|<\delta$ , there is:
${\begin{aligned}&|(f+g)(x)-(f+g)(a)|\\[0.3em]&\quad {\color {Gray}\left\downarrow \ {\text{definition of the function }}(f+g)\right.}\\[0.3em]&=|f(x)+g(x)-(f(a)+g(a))|\\[0.3em]&\quad {\color {Gray}\left\downarrow \ {\text{associativity of }}\mathbb {R} \right.}\\[0.3em]&=|(f(x)-f(a))+(g(a)-g(x))|\\[0.3em]&\quad {\color {Gray}\left\downarrow \ {\text{triangle inequality}}\right.}\\[0.3em]&\leq \underbrace {|f(x)-f(a)|} _{\color {Gray}<\epsilon /2{\text{, da }}|x-a|<\delta \leq \delta _{f}}+\underbrace {|g(a)-g(x)|} _{\color {Gray}<\epsilon /2{\text{, da }}|x-a|<\delta \leq \delta _{g}}\\[0.3em]&<\epsilon /2+\epsilon /2=\epsilon \end{aligned}}$

### Continuity of scalar multiplication

Theorem (Concatenation theorem for scalar multiplication)
Let $D\subseteq \mathbb {R}$ and $\lambda \in \mathbb {R}$. Further, let $f:D\to \mathbb {R}$ be a real-valued function, which is continuous at $a\in D$ . Then, $\lambda f:D\to \mathbb {R} :x\mapsto \lambda \cdot f(x)$ is continuous at $a$ , as well.
Proof (Concatenation theorem for scalar multiplication)
We will prove continuity of $\lambda f$ in $a$ by checking the sequence criterion. Let $\left(x_{n}\right)_{n\in \mathbb {N} }$ be any sequence with $x_{n}\in D$ for all $n\in \mathbb {N}$ and converging as $\lim _{n\to \infty }x_{n}=a$. Since $f$ is continuous at $a$ , the limit $\lim _{n\to \infty }f(x_{n})=f(a)$ exists. Now there is:
${\begin{aligned}&\lim _{n\to \infty }(\lambda f)(x_{n})\\[0.3em]&\quad {\color {Gray}\left\downarrow \ {\text{definition of the function }}(\lambda f)\right.}\\[0.3em]&=\lim _{n\to \infty }\left(\lambda \cdot f(x_{n})\right)\\[0.3em]&\quad {\color {Gray}\left\downarrow \ {\text{factor rule for limits}}\right.}\\[0.3em]&=\lambda \cdot \lim _{n\to \infty }f(x_{n})\\[0.3em]&\quad {\color {Gray}\left\downarrow \ f{\text{ continuous}}\right.}\\[0.3em]&=\lambda \cdot f(a)\\[0.3em]&\quad {\color {Gray}\left\downarrow \ {\text{definition of the function }}(\lambda f)\right.}\\[0.3em]&=(\lambda f)(a)\end{aligned}}$

### Continuity under multiplication

Theorem (Concatenation theorem for multiplication)
Let $D\subseteq \mathbb {R}$ and let $f,g:D\to \mathbb {R}$ be real-valued functions , which are continuous at $a\in D$ . Then, $fg:D\to \mathbb {R} :x\mapsto f(x)\cdot g(x)$ is continuous at $a$ , as well.
Proof (Concatenation theorem for multiplication)
We will establish continuity of the product $fg$ by checking the sequence criterion. Let $\left(x_{n}\right)_{n\in \mathbb {N} }$ be any sequence with $x_{n}\in D$ for all $n\in \mathbb {N}$ and $\lim _{n\to \infty }x_{n}=a$. As both $f$ and $g$ are continuous at $a$ , the two limits $\lim _{n\to \infty }f(x_{n})=f(a)$ and $\lim _{n\to \infty }g(x_{n})=g(a)$ exist. Now, there is:
${\begin{aligned}&\lim _{n\to \infty }(fg)(x_{n})\\[0.3em]&\quad {\color {Gray}\left\downarrow \ {\text{definition of the function }}(fg)\right.}\\[0.3em]&=\lim _{n\to \infty }\left(f(x_{n})\cdot g(x_{n})\right)\\[0.3em]&\quad {\color {Gray}\left\downarrow \ {\text{product rule for limits}}\right.}\\[0.3em]&=\lim _{n\to \infty }f(x_{n})\cdot \lim _{n\to \infty }g(x_{n})\\[0.3em]&\quad {\color {Gray}\left\downarrow \ f{\text{ and }}g{\text{ are continuous}}\right.}\\[0.3em]&=f(a)\cdot g(a)\\[0.3em]&\quad {\color {Gray}\left\downarrow \ {\text{definition of the function }}(fg)\right.}\\[0.3em]&=(fg)(a)\end{aligned}}$

### Continuity of quotients

Theorem (Concatenation theorem for quotients)
Let $D\subseteq \mathbb {R}$ and let $f:D\to \mathbb {R}$ and $g:D\to \mathbb {R}$ be two real-valued functions. Define the domain without 0 by $D'=\{x\in D:g(x)\neq 0\}$ and suppose that $f$ and $g$ are both continuous at all $a\in D'$. Then, the quotient ${\tfrac {f}{g}}:D'\to \mathbb {R}$ will be continuous at $a$ , as well.
Proof (Concatenation theorem for quotients)
The proof will be done by checking the sequence criterion using the quotient rule for limits . Let $\left(x_{n}\right)_{n\in \mathbb {N} }$ be any sequence with $x_{n}\in D'$ for all $n\in \mathbb {N}$ and $\lim _{n\to \infty }x_{n}=a$. Since both the function $f$ and $g$ are continuous at $a$ , it follows that $\lim _{n\to \infty }f(x_{n})=f(a)$ and $\lim _{n\to \infty }g(x_{n})=g(a)$. Furthermore, there is $g(x_{n})\neq 0$, so ${\tfrac {f}{g}}(x_{n}):={\tfrac {f(x_{n})}{g(x_{n})}}$ is well-defined for all $n\in \mathbb {N}$ . Thus:
${\begin{aligned}&\lim _{n\to \infty }{\frac {f}{g}}(x_{n})\\[0.3em]&\quad {\color {Gray}\left\downarrow \ {\text{definition of the function }}{\tfrac {f}{g}}\right.}\\[0.3em]&=\lim _{n\to \infty }{\frac {f(x_{n})}{g(x_{n})}}\\[0.3em]&\quad {\color {Gray}\left\downarrow \ {\text{quotient rules for limits}}\right.}\\[0.3em]&={\frac {\lim _{n\to \infty }f(x_{n})}{\lim _{n\to \infty }g(x_{n})}}\\[0.3em]&\quad {\color {Gray}\left\downarrow \ f{\text{ and }}g{\text{ are continuous}}\right.}\\[0.3em]&={\frac {f(a)}{g(a)}}\\[0.3em]&\quad {\color {Gray}\left\downarrow \ {\text{definition of the function }}{\tfrac {f}{g}}\right.}\\[0.3em]&={\frac {f}{g}}(a)\end{aligned}}$

### Continuity of compositions

Theorem (Concatenation theorem for compositions)
Let $D\subseteq \mathbb {R}$ and $f:D\to \mathbb {R}$ a function continuous in $a\in D$ . In addition, let $h:E\to \mathbb {R}$ be a function with $f(D)\subseteq E$, which is continuous in $b=f(a)\in E$ . Then, $h\circ f:D\to \mathbb {R}$ is continuous in $a$, as well.
Proof (Concatenation theorem for compositions)
We will prove continuity of $h\circ f$ at $a$ by checking the sequence criterion. Let $\left(x_{n}\right)_{n\in \mathbb {N} }$ be any sequence with $x_{n}\in D$ for all $n\in \mathbb {N}$ converging like $\lim _{n\to \infty }x_{n}=a$. Then, $\left(f(x_{n})\right)_{n\in \mathbb {N} }$ is a sequence with $f(x_{n})\in E$ for all $n\in \mathbb {N}$ (since $f(D)\subseteq E$) and there is $\lim _{n\to \infty }f(x_{n})=f(a)$ (since $f$ is continuous). Therefore:
${\begin{aligned}&\lim _{n\to \infty }(h\circ f)(x_{n})\\[0.3em]&\quad {\color {Gray}\left\downarrow \ {\text{definition of the composition}}\right.}\\[0.3em]&=\lim _{n\to \infty }h(f(x_{n}))\\[0.3em]&\quad {\color {Gray}\left\downarrow \ {\text{sequence criterion for }}h\right.}\\[0.3em]&=h\left(\lim _{n\to \infty }f(x_{n})\right)\\[0.3em]&\quad {\color {Gray}\left\downarrow \ {\text{continuity of }}f{\text{ at }}a\right.}\\[0.3em]&=h\left(f(a)\right)\\[0.3em]&\quad {\color {Gray}\left\downarrow \ {\text{definition of the composition}}\right.}\\[0.3em]&=(h\circ f)(a)\end{aligned}}$

## Comparison with the epsilon-delta criterion

In the beginning of this article, we used the concatenation theorems in order to show that the function ${\sqrt {5+x^{2}}}$ is continuous. We will no perform a second proof "by hand", using the epsilon-delta criterion. The proof will cost us more work, but we will get an explicit information on the maximal initial error $\delta$ we have to choose, in order to stay below a given threshold $\epsilon >0$ for the error of the outcome.
Math for Non-Geeks: Template:Aufgabe