Infinitely iterating the cosine function yields the Dottie number For simplicity’s sake, Let’s define our function to be cos(x).
For any value of x, iterating this function will yield some constant, take a calculator and try it.
But quite surprisingly, I recognized that number to be the solution to the equation cos(x)=x.
I do have an intuitive but not so rigorous answer though, and I may present it:
We will start by this really obvious equality
cos(cos(cos(cos(...cos(x)=cos(cos(cos(cos(...cos(x) (note that this iteration is infinite somehow, and it will be clear why in the next step)
Let’s set y=cos(cos(cos(...cos(x))
Substituting in our new variable yields this transcendental equation
cos(y)=y so y= 0.73908513322... (which is known as the Dottie number)
But does this apply to any function f(x)? I have so many questions.

For a given function $f : X \to X$, we call $x^*$ a fixed point iff $f(x^*) = x^*$. You've observed that $\cos : \Bbb R \to \Bbb R$ has a fixed point $x_0=0.73908\ldots$. Moreover, since for $\cos$ there is some interval $I$ containing $x_0$ such that $\cos^{(n)} x \to x_0$ (as $n \to \infty$), for all $x \in I$ (in fact, we can take $I = \Bbb R$ here), we call $x_0$ an attracting fixed point of $\cos$.
Some functions have no fixed points, let alone attracting ones: For example, for $$g: \Bbb R \to \Bbb R, \qquad g(x) = x + 1,$$ there is no value $x^*$ such that $g(x^*) = x^*$. (Indeed, $g^{(n)}(x) = x + n$, so $g^{(n)}(x) \to \infty$ for all $x \in \Bbb R$.)
Other functions have more than one fixed point. For example, the fixed points of $$h: \Bbb R \to \Bbb R, \qquad h(x) = x + \sin x,$$ are $x^* = k \pi$, $k \in \Bbb Z$, but $k \pi$ is an attracting fixed point only when $k$ is odd.
There are conditions that guarantee a given function $f : X \to X$ has some fixed point. A special case of the Banach Fixed-Point Theorem says that if $f : \Bbb R \to \Bbb R$ is a differentiable function and $I$ is some interval, and there is some $\alpha \in [0, 1)$ such that $|f'(x)| < \alpha$ for all $x \in I$, then $f$ has some attracting fixed point $x^* \in I$ and $f^{(n)}(x) \to x^*$ for all $x \in I$.
We cannot apply this result immediately to $\cos : \Bbb R \to \Bbb R$, since $\left\vert\cos'\left(\frac{\pi}{2}\right)\right\vert = 1$, so for $I = \Bbb R$ there is no $\alpha$ satisfying the above condition. But $\cos(\Bbb R) = [-1, 1]$, and on that interval, $|\cos'(x)| \leq \sin 1 < 1$, so the theorem tells us that there is an attracting fixed point $x_0$ in $[-1, 1]$, and we can conclude that $\cos^{(n)}(x) \to x_0$ for all $x$.
