Solution (source code)

= Solution

The <contraction mapping theorem> states that a <contraction mapping> $T:X\to X$ on a nonempty <complete metric space> has a unique <fixed point>. Here contraction means that some $0\le q<1$ satisfies $d(Tx,Ty)\le qd(x,y)$ for all $x,y$.

For a proof, choose $x_0$ and iterate $x_{r+1}=Tx_r$. Induction gives $d(x_{r+1},x_r)\le q^rd(x_1,x_0)$. For $m>n$, the triangle inequality and a <geometric series> give
$$
d(x_m,x_n)\le\sum_{r=n}^{m-1}q^rd(x_1,x_0)\le\frac{q^n}{1-q}d(x_1,x_0).
$$
Thus the iterates form a <Cauchy sequence>, and <completeness> supplies a limit $a\in X$. A <contraction mapping> is continuous, so $Ta=\lim Tx_n=\lim x_{n+1}=a$. If $b$ is another <fixed point>, $d(a,b)=d(Ta,Tb)\le qd(a,b)$, forcing $d(a,b)=0$. This proves existence and uniqueness.

For the exponential problem, use $h=f\circ f$ on the complete <metric space> $\mathbb R$. Its <derivative> is
$$
h'(x)=e^{-x}e^{-e^{-x}}.
$$
Putting $t=e^{-x}>0$, the function $te^{-t}$ has maximum $1/e$ at $t=1$, as its <derivative> is $(1-t)e^{-t}$. By the <mean value theorem>, $|h(x)-h(y)|\le e^{-1}|x-y|$, so $h$ is a <contraction mapping> on all of $\mathbb R$. Let $a$ be its unique <fixed point>. The compositions commute, so $h(f(a))=f(h(a))=f(a)$; uniqueness of the <fixed point> of $h$ forces $f(a)=a$. Conversely every <fixed point> of $f$ is fixed by $h$. Hence \b[there is exactly one real solution of $x=e^{-x}$]. It lies in $(0,1)$ because $a=e^{-a}>0$ and then $e^{-a}<1$. This uses the <iterated contraction> argument without claiming that $f$ itself contracts on all of $\mathbb R$.