Let $ f(x)=\frac{1+\cos(2\pi x)}2$ and $f^n=f\circ f^{n-1}$. Is it true that for almost every $x$, $\lim_{n \to \infty} f^n(x)=1$? 
Let $\displaystyle f(x)=\frac{1+\cos(2\pi x)}2$ for $x\in\mathbb R$, and $f^n=\underbrace{ f \circ \cdots \circ f}_{n}$. Is it true that for Lebesgue almost every $x$, $\displaystyle\lim_{n \to \infty} f^n(x)=1$?

I'm more inclined to believe that the answer is "yes".
This is the Problem $5$ of $2021$ Miklós Schweitzer. Recently, a related question reminds me of this problem. After spending some time on it, I found that it is a hard problem, as always as Miklós Schweitzer does. Almost every problem from that competition is very difficult for me.
First of all, for a fixed $x_0\in\mathbb R$, if $f^n(x_0)$ is convergent, then its limit $\ell$ must be a fixed point of $f$. Since $f(x)=\cos^2(\pi x)\in[0,1]$, we must have $\ell\in[0,1]$. Let's find the fixed points of $f$. Let $g(x)=f(x)-x$ for $x\in[0,1]$, then we need to find the zeroes of $g$. Since $g'(x)=-\pi\sin(2\pi x)-1$, $g'$ has two zeroes $\eta_1,\eta_2\in[0,1]$ with $1/2<\eta_1<3/4$, $3/4<\eta_2<1$, and $\sin(2\pi\eta_1)=\sin(2\pi\eta_2)=-1/\pi$. Hence, $g$ is decreasing in $[0, \eta_1)$, then increasing in $(\eta_1, \eta_2)$, and then decreasing in $(\eta_2,1]$. Note that $g(1/2)=-1/2<0, g(1)=0$, we know that $g(\eta_1)<0$ and $g(\eta_2)>0$. Therefore, we can find three zeroes of $g$, named by $\ell_1$, $\ell_2$ and $\ell$ with $\ell_1\in(0,1/2)$, $\ell_2\in(\eta_1, \eta_2)$ and $\ell=1$.

We can find the locations the fixed points $\ell_1, \ell_2$ more accurately. Indeed, since
$$g\left(\frac14\right)=\cos^2\left(\frac\pi4\right)-\frac14=\frac12-\frac14>0,\qquad g\left(\frac13\right)=\cos^2\left(\frac\pi3\right)-\frac13=\frac14-\frac13<0,$$
we have $\ell_1\in(1/4,1/3)$, hence
$$f'(\ell_1)=-\pi\sin(2\pi\ell_1)<-\pi\sin\left(\frac{2\pi}3\right)=-\frac{\sqrt 3}2\pi<-1.$$
Also,
$$g\left(\frac56\right)=\cos^2\left(\frac56\pi\right)-\frac56=\frac34-\frac56<0,\qquad g\left(\frac{11}{12}\right)=\frac{1+\cos\left(\frac{11}6\pi\right)}2-\frac{11}{12}=\frac{\sqrt3-2}4>0,$$
we have $\ell_2\in(5/6,11/12)$, hence
$$f'(\ell_2)=-\pi\sin(2\pi\ell_2)>-\pi\sin\left(\frac{11\pi}6\right)=\frac{1}2\pi>1.$$
The following are not rigorous.
Therefore, locally, near $\ell_1$, $f$ behaves like $-A(x-\ell_1)$ with $A>1$. Consider the map $f_1: x\mapsto -Ax$, then $f_1^n(x)$ converges if and only if $x=0$. This indicates that, for fixed $x_0$, if the sequence $\{f^n(x_0)\}$ doesn't reach $\ell_1$, it will not converge to $\ell_1$ ; a similar analysis on $\ell_2$ indicates that $\{f^n(x_0)\}$ will not converge to $\ell_2$ if it doesn't touch $\ell_2$; hence, if $\{f^n(x_0)\}$ converges without touching $\ell_1, \ell_2$, then the limit should must be $\ell=1$. I think the ideas in this paragraph can be written down rigorously, although I don't know how to write a clean one.
Another question I've not had any ideas: What if $\{f^n(x_0)\}$ diverges? To finish the problem, even if we write down a proof about the above paragraph, we also need to prove that for a.e. $x$, the sequence $\{f^n(x)\}$ is convergent.
Any help would be appreciated!
 A: Let $\ell_1<\ell_2<1$ be the three fixed points of $f$.The idea is to follow where certain subintervals of $[0,1]$ get mapped and to show that in a finite number of iterations, such subintervals fall into $[\ell_2,1]$ where the dynamics of the system is obvious.

*

*Notice that $[\ell_2,1]\mapsto [\ell_2,1]$ and since $f(x)>x$ and $f$ increases in $[\ell_2,1]$, for $x\in (\ell_2,1]$, $f^n(x)\xrightarrow{n\rightarrow\infty}1$.

The key now is to show that with the exception of preimages (of preimages) of the points $\ell_1$ and $\ell_2$ and of the root $z$, all other points get mapped into $(\ell_2,1]$.


*Since $f$ decreases in $[0,\ell_1]$ and $f(x)>x$ on $[0,\ell_1)$, there is a point $0<\ell^{(1)}_2<\ell_1$ such that $f(\ell^{(1)}_2)=\ell_2$. Notice that $[0,\ell^{(1)}_2]\mapsto[\ell_2,1]$. Then by (1), iterations of $f$ at points in $[0,\ell_2')$ converge to $1$.


*$f$ has a (the only one) zero $\ell_1<z<\ell_2$. Notice that
$[\ell_1,z]\mapsto[0,\ell_1]$ and $[z,\ell_2]\mapsto[\ell_1,\ell_2]$, Thus, the interesting dynamics happens in $[\ell^{(1)}_2,\ell_2]$.


*There is $\ell_1<\ell^{(2)}_2<z$ such that $f(\ell^{(2)}_2)=\ell^{(1)}_2$. Notice that $[\ell^{(2)}_2,z]\mapsto[0,\ell^{(1)}_2]$ and from there we get to $[\ell_2,1]$.


*There are points $z<\ell^{(3)}_2<\ell^{(1)}_1<\ell_2$ such that $f(\ell^{(3)}_2)=\ell^{(1)}_2$ and $f(\ell^{(1)})=\ell_1$. Notice that $[z,\ell^{(3)}_2]\mapsto[0,\ell^{(1)}_2]$ and from there we get to $[\ell_2,1]$.
We may proceed this way by partitioning the remaining subintervals in $[\ell^{(1)}_2,\ell^{(2)}_2]$ and $[\ell^{(3)}_2,\ell_2]$  using higher order preimages of $z$ and $\ell_1$ and $\ell_2$. To make this much clearer, we may have to use a much better labeling of preimages to denote the order of a preimage., and possibly use symbolic dynamics.
