# Math for Non-Geeks/ Continuity of the inverse function

In this chapter we will introduce a theorem that gives a sufficient condition for the continuity of the inverse function of a bijective function. In mathematical literature this theorem is often referred to as the "Inverse function Theorem". What is astounding about this result is that the inverse function of a discontinuous function can actually be continuous.

## Motivation

First we want to consider the most general condition possible for when a bijective function $f:D\to W$ with $D,W\subseteq \mathbb {R}$ has a continuous inverse function. The first ansatz that we naturally wan to investigate is the continuity of $f$ itself. We might spontaneously assume that the continuity of the inverse function $f^{-1}$ follows directly from the continuity of $f$. This is not necessarily the case, as is shown in the following example:
${\begin{aligned}f&:([-1,0]\cup (1,2])\to [-1,1]\\[1em]&:x\mapsto f(x)={\begin{cases}x&-1\leq x\leq 0\\x-1&1<x\leq 2\end{cases}}\end{aligned}}$
The function is continuous since it's continuous on both $[-1,0]$ and $(1,2]$. Furthermore it is strictly monotonically increasing, so it's injective. The image of $f$ is $[-1,1]$ and therefore $f:([-1,0]\cup (1,2])\to [-1,1]$ is surjective. All together, $f$ is bijective and therefore invertible. The inverse mapping $f^{-1}:[-1,1]\to ([-1,0]\cup (1,2])$ has functional values:
$f^{-1}(y)={\begin{cases}y&-1\leq y\leq 0\\y+1&0<y\leq 1\end{cases}}$
The inverse function is not continuous since it has a jump discontinuity at $y=0$. So it can definitely be the case that a continuous function has a discontinuous inverse.
But now another thing is apparent: the inverse function $f^{-1}=g$ is also invertible with the inverse function $g^{-1}=\left(f^{-1}\right)^{-1}=f$. This means, however, that a discontinuous function (like $g$) can have a continuous inverse function. Hence, we posit:
The problem lies in the domain of $f$. Namely, this is $[-1,0]\cup (1,2]$, i.e. not an interval. The domain is not connected and has a "gap." How does this "gap" affect the inverse function $f^{-1}$?
Since the domain of $f$ corresponds to what should be the codomain of $f^{-1}$, the inverse function also has this "gap" in its codomain. Similarly, the codomain of $f$ corresponds to the domain of $f^{-1}$. It is for this reason that $f^{-1}$ can not be continuous. The domain of $f$ is an interval and therefore connected, while its codomain contains a gap. Since $f^{-1}$ is surjective and must attain every value in what should be its codomain, the graph of $f^{-1}$ must lend itself to a jump point somewhere. This is why $f^{-1}$ is not continuous.
Thus, we must require that, by assumption, the domain of $f$ is an interval to ensure that we don't encounter any problems. Usually this requirement is sufficient to guarantee the continuity of $f^{-1}$. We can prove this using the $\epsilon$-$\delta$ characterization of continuity. With the help of Zwischenwertsatzes we can futhermore conclude that the codomain of $f$ - and therefore the domain of $f^{-1}$ - is an interval.

## Theorem on the Continuity of the Inverse Function

Theorem (Continuity of the Inverse Function)
Let $D\subseteq \mathbb {R}$ be an interval and $f:D\to W$ a surjective, strictly monotone, and continuous mapping. Then $f$ is bijective, and the inverse function
$f^{-1}:W\to D$
is continuous and in the same sense as $f$ strictly monotone. Furthermore, $f(D)=W$ is an interval.
Proof (Continuity of the Inverse Function)
Proof step: $f$ is bijective
Let $x,y\in D$ with $x\neq y$. Then it either mus be the case $x<y$ or $x>y$. Since $f$ is strictly monotone, it follows $f(x)<f(y)$ or $f(x)>f(y)$. In either case it holds $f(x)\neq f(y)$. So therefore $f$ is injective. Since $f$ is surjective by assumption, the mapping is bijective.
Proof step: $f^{-1}$ is strictly monotone
Without loss of generality let $f$ be strictly monotone increasing, i.e. $f(x)<f(y)$ follows from $x,y\in D$ with $x<y$. Now let ${\tilde {x}},{\tilde {y}}\in W$ with ${\tilde {x}}<{\tilde {y}}$. Now we ust show that $f^{-1}({\tilde {x}})<f^{-1}({\tilde {y}})$.
There exist some $x,y\in D$ with $f(x)={\tilde {x}}$ and $f(y)={\tilde {y}}$. Therefore, $f^{-1}({\tilde {x}})=f^{-1}(f(x))=x$ and $f^{-1}({\tilde {y}})=f^{-1}(f(y))=y$. Since $f^{-1}$ is injective, it holds $x\neq y$. It also can not be the case that $x>y$ holds. Otherwise it must then hold ${\tilde {x}}=f(x)>f(y)={\tilde {y}}$, which can not be the case because ${\tilde {x}}<{\tilde {y}}$.
Thus, $x<y$ and $f^{-1}({\tilde {x}})<f^{-1}({\tilde {y}})$. This proves that $f^{-1}$ is strictly monotone increasing like $f$. Proving that $f^{-1}$ is striclty monotone decreasing when we assume $f$ is strictly monotone decreasing is analogous.
Proof step: $f^{-1}$ is continuous
We will use the $\epsilon$-$\delta$-characterization of continuity. To that end, let $\epsilon >0$ and let $b\in W=f(D)$ be arbitrary. Further, let $a=f^{-1}(b)$ be the preimage of $b$ under $f$, i.e. $f(a)=b$. Now we have to show that there exists some $\delta >0$ such that $|f^{-1}(y)-f^{-1}(b)|<\epsilon$ holds for all $y\in W$ with $|y-b|<\delta$. Then we will have achieved showing $f^{-1}$ is continuous in $b$. Since $b\in W$ can be chosen arbitrarily, from there we can conclude the continuity of the mapping $f^{-1}:W\to D$. We must, however, differentiate between the two cases of whether or not $a$ is a boundary point of $D$:
Case 1: $a$ is not a boundary point of $D$
Since $a$ is not a boundary point of $D$, there exists some ${\tilde {\epsilon }}$ with $0<{\tilde {\epsilon }}<\epsilon$ and $]a-{\tilde {\epsilon }},a+{\tilde {\epsilon }}[\subseteq D$. We set $b_{1}=f(a-{\tilde {\epsilon }})$ and $b_{2}=f(a+{\tilde {\epsilon }})$. If $f$ is strictly monotone increasing, then it holds $b_{1}<b<b_{2}$. If $f$ is strictly monotone decreasing, then it holds $b_{2}<b<b_{1}$. Thus, $f$ maps the interval $[a-{\tilde {\epsilon }},a+{\tilde {\epsilon }}]$ bijectively to $[b_{1},b_{2}]$ and $[b_{2},b_{1}]$. If we set
$\delta =\min\{|b-b_{1}|,|b-b_{2}|\}$
then it follows
$f^{-1}b-\delta ,b+\delta\subseteq ]a-{\tilde {\epsilon }},a+{\tilde {\epsilon }}[\subseteq ]a-\epsilon ,a+\epsilon [$
Hence, the condition $|f^{-1}(y)-f^{-1}(b)|<\epsilon$ for all $y\in W$ with $|y-b|<\delta$ is fulfilled and $f^{-1}$ is continuous in $b$.
Case 2: $a$ is a boundary point of $D$
We may assume without loss of generality that $a$ is the maximum of $D$. Now there exists some ${\tilde {\epsilon }}$ with $0<{\tilde {\epsilon }}<\epsilon$ such that $a-{\tilde {\epsilon }}$ lies in $D$. Therefore the value $f(a-{\tilde {\epsilon }})$ exists and we can set $\delta =|f(a)-f(a-{\tilde {\epsilon }})|$.
If $f$ is strictly monotone increasing, then $f$ maps the interval $[a-{\tilde {\epsilon }},a]$ bijectively to $[f(a-{\tilde {\epsilon }}),f(a)]=[b-\delta ,b]$. Then it holds $f^{-1}([b-\delta ,b])=[a-{\tilde {\epsilon }},a]\subseteq (a-\epsilon ,a+\epsilon )$. Because no $y\in W$ exists with $y>b$, it must therefore hold $|f^{-1}(y)-f^{-1}(b)|<\epsilon$ for all $y\in W$ with $|y-b|<\delta$. This proves the continuity of $f^{-1}$ in $b$. The proof for the case where $f$ is monotone decreasing is analogous.

## Examples
### Root Functions

Example (Root Functions)
If $k\in \mathbb {N}$ with $k\geq 2$, then the $k$-th power function is defined as
$f:\mathbb {R} ^{+}\to \mathbb {R} ^{+}:x\mapsto f(x)=x^{k}$
This is a strictly monotonically increasing function, since for $x,y\in \mathbb {R} ^{+}$ with $x<y$ it holds
$f(x)=x^{k}=\underbrace {x\cdot \ldots \cdot x} _{k-{\text{mal}}}<\underbrace {y\cdot \ldots \cdot y} _{k-{\text{mal}}}=y^{k}=f(y)$
Furthermore, this means $f$ is injective. The function $f$ is also surjective, since for every $y\in \mathbb {R} ^{+}$ it holds for $x={\sqrt[{k}]{y}}$:
$f(x)=f\left({\sqrt[{k}]{y}}\right)=\left({\sqrt[{k}]{y}}\right)^{k}=y$
The inverse function is the $k$-th root function $f^{-1}:\mathbb {R} ^{+}\to \mathbb {R} ^{+}$ with $f(x)={\sqrt[{k}]{x}}$.By the Inverse Function Theorem, this function is continuous and also strictly monotone increasing.

### Natural Logarithm Functions

Example (Natural Logarithm Functions)
The exponential function
$f:\mathbb {R} \to \mathbb {R} ^{+},\ f(x)=\exp(x)$
is strictly monotone increasing. Let $x,y\in \mathbb {R} ^{+}$ with $x<y$. Then there exists some $t\in \mathbb {R} ^{+}$ with $y=x+t$. It therefore holds
$\exp(y)=\exp(x+t){\underset {\text{equation}}{\overset {\text{functional}}{=}}}\exp(x)\cdot \underbrace {\exp(t)} _{>1}>\exp(x)$
From the strict monotonicity it follows that $\exp$ is injective. Furthermore, the exponential function is surjective since:
${\begin{aligned}\lim _{x\to \infty }\exp(x)&=\infty \lim _{x\to -\infty }\exp(x)&=0\end{aligned}}$
The surjectivity follows from the continuity of the exponential function and the Intermediate Value Theorem. The inverse function of the exponential function is the so-called natural logarithm function:
$f^{-1}:\mathbb {R} ^{+}\to \mathbb {R} ,\ f(x)=\ln x$
This function is also strictly monotone increasing (which is a result of the strict monotonicity of the exponential function). Furthermore, we can apply the Inverse Function Theorem and conclude that the logarithm function is also continuous.

## Exercises
### Exercise 1

Exercise (Continuity of the Inverse Function)
Let $f:\mathbb {R} \to \mathbb {R}$ be defined by the following values:
$f(x)={\frac {x}{1+|x|}}$
Prove the following claims:
* Show that $f$ is continuous, strictly monotone increasing, and injective on $\mathbb {R}$.
* Show that $f:\mathbb {R} \to (-1,1)$ is surjective.
* Give a justification for why the inverse function $f^{-1}:(-1,1)\to \mathbb {R}$ exists and determine the explicit functional values for $f^{-1}$. Show that $f^{-1}$ is continuous and strictly monotone increasing.
Solution (Continuity of the Inverse Function)
Solution sub-exercise 1:
$f$ is continuous since it is the quotient of continuous functions $a:\mathbb {R} \to \mathbb {R} :x\mapsto x$ and $b:\mathbb {R} \to \mathbb {R} :x\mapsto 1+|x|$. $1+|x|\neq 0$ thereby holds for all $x\in \mathbb {R}$. Let $x,y\in \mathbb {R}$ with $x<y$. To prove the strict monotonicity we will show $f(x)<f(y)$:
Case 1: $x,y\geq 0$
Then it holds
$x<y\iff \underbrace {x+xy} _{=x(1+y)}<\underbrace {y+xy} _{=y(1+x)}\iff \underbrace {\frac {x}{1+x}} _{=f(x)}<\underbrace {\frac {y}{1+y}} _{=f(y)}$
Case 2: $x\leq 0<y$
Here it holds
$f(x)=\underbrace {\frac {x}{1+|x|}} _{\leq 0}<\underbrace {\frac {y}{1+|y|}} _{>0}=f(y)$
Case 3: $x<0\leq y$
Here it holds
$f(x)=\underbrace {\frac {x}{1+|x|}} _{<0}<\underbrace {\frac {y}{1+|y|}} _{\geq 0}=f(y)$
Case 4: $x,y<0$
It holds
$x<y\iff \underbrace {x-xy} _{=x(1-y)}<\underbrace {y-xy} _{=y(1-x)}\iff \underbrace {\frac {x}{1-x}} _{=f(x)}<\underbrace {\frac {y}{1-y}} _{=f(y)}$
So then $f$ is strictly monotone increasing on $\mathbb {R}$ and therefore also injective.
Solution sub-exercise 2:
It holds for all $x\in \mathbb {R}$:
$|f(x)|={\frac {|x|}{1+|x|}}<{\frac {|x|}{|x|}}=1$
It follows immediately that $-1<f(x)<1$ holds. Furthermore,
${\begin{aligned}\lim _{x\to \infty }f(x)&=\lim _{x\to \infty }{\frac {x}{1+|x|}}\\[0.3em]&=\lim _{x\to \infty \atop x>0}{\frac {x}{1+|x|}}\\[0.3em]&=\lim _{x\to \infty \atop x>0}{\frac {x}{1+x}}\\[0.3em]&=\lim _{x\to \infty \atop x>0}{\frac {1}{{\frac {1}{x}}+1}}=1\end{aligned}}$
and
${\begin{aligned}\lim _{x\to -\infty }f(x)&=\lim _{x\to -\infty }{\frac {x}{1+|x|}}\\[0.3em]&=\lim _{x\to -\infty \atop x<0}{\frac {x}{1+|x|}}\\[0.3em]&=\lim _{x\to -\infty \atop x<0}{\frac {x}{1-x}}\\[0.3em]&=\lim _{x\to -\infty \atop x<0}{\frac {1}{{\frac {1}{x}}-1}}=-1\end{aligned}}$
Since $f$ is continuous, by the Intermediate Value Theorem, for every $y\in (-1,1)$ there exists an $x\in \mathbb {R}$ with $f(x)=y$. So it holds for the image that $f(\mathbb {R} )=(-1,1)$, whereby $f:\mathbb {R} \to (-1,1)$ is surjective.
Solution sub-exercise 3:
Since $f$ is bijective, the inverse function $f^{-1}:(-1,1)\to \mathbb {R}$ exists. As an inverse function, $f^{-1}$ is also bijective. By the Theorem of Continuity of the Inverse Function, $f^{-1}$ is furthermore continuous and strictly monotone increasing. In order to calculate $f^{-1}$ we must first differentiate between two cases:
Case 1: $x\geq 0$
${\begin{aligned}&y=f(x)={\frac {x}{1+x}}\\\iff&y+xy=x\\\iff&y=x-xy=x(1-y)\\\iff&x=\underbrace {\frac {y}{1-y}} _{=f^{-1}(y)}\end{aligned}}$
Case 2: $x<0$
${\begin{aligned}&y=f(x)={\frac {x}{1-x}}\\\iff&y-xy=x\\\iff&y=x+xy=x(1+y)\\\iff&x=\underbrace {\frac {y}{1+y}} _{=f^{-1}(y)}\end{aligned}}$
If we now have $x\geq 0$, then $f(x)=y\geq 0$ and therefore $1-y=1-|y|$. On the other hand, if $x<0$, then so is $f(x)=y<0$ and therefore $1+y=1-|y|$. All together, we can conclude
$f^{-1}:(-1,1)\to \mathbb {R} ,\ f^{-1}(y)={\frac {y}{1-|y|}}$

### Exercise 2

Exercise (Continuity of the Inverse Function 2)
Let $g:[0,\infty )\to \mathbb {R}$ with $g(x)=\exp(x)-\sin(\exp(-x))$
* Show that $g$ is injective.
* Determine the image $g([0,\infty ))$.
* Justify why the inverse function $g^{-1}:g([0,\infty ))\to [0,\infty )$ is continuous.
Solution (Continuity of the Inverse Function 2)
Solution sub-exercise 1:
$g$ is continuous as it is the composition of the continuous functions $a:[0,\infty )\to \mathbb {R} :x\mapsto -x$, $b:[0,\infty )\to \mathbb {R} :x\mapsto \exp(x)$ and $c:[0,\infty )\to \mathbb {R} :x\mapsto \sin(x)$. Furthermore, for $x,y\in [0,\infty )$ with $x<y$ it holds:
$x<y\implies -x>-y\implies \exp(-x)>\exp(-y)$
Now it holds $\exp(-{\tilde {x}})\in (0,1]$ for ${\tilde {x}}\in [0,\infty )$. Since the sine function is strictly monotone increasing on the half-interval $(0,1]$, it follows
$\exp(-x)>\exp(-y)\implies \sin(\exp(-x))>\sin(\exp(-y))\implies -\sin(\exp(-x))<-\sin(\exp(-y))$
Because the exponential function is strictly monotone increasing, it furthermore holds that $\exp(x)<\exp(y)$. Then we have:
$\underbrace {\exp(x)-\sin(\exp(-x))} _{=g(x)}<\underbrace {\exp(y)-\sin(\exp(-y))} _{=g(y)}$
So $g$ is strictly monotone increasing and therefore injective.
Solution sub-exercise 2:
= First, we observe
$g(0)=\exp(0)-\sin(\exp(0))=1-\sin(1)$
Furthermore,
${\begin{aligned}\lim _{x\to \infty }\exp(x)&=\infty \\\lim _{x\to \infty }\exp(-x)&=0\end{aligned}}$
and from there it follows that
$\lim _{x\to \infty }g(x)=\lim _{x\to \infty }[\underbrace {\exp(x)} _{\to \infty }-\underbrace {\sin(\exp(-x))} _{\to \sin(0)=0}]=\infty$
Since $g$ is continuous and $[0,\infty )$ is an interval, $g([0,\infty ))$ is also an interval (see „Folgerung zum Zwischenwertsatz“). Since $g$ is strictly monotone increasing and $\lim _{x\to \infty }g(x)=\infty$, it follows
$g([0,\infty ))=[g(0),\infty )=[1-\sin(1),\infty )$
Solution sub-exercise 3:
Since $D=[0,\infty )$ is an interval and $g:[0,\infty )\to [1-\sin(1),\infty )$ is bijective, the inverse function $g^{-1}:[1-\sin(1),\infty )\to [0,\infty )$ is continuous by the Continuous Inverse Function Theorem.