Iteration of continuous function on compact interval Let $f:[0,1]\to [0,1]$ be continuous function. Moreover assume that for every $u\in [0,1]$ there exists $n(u)\in \mathbb{N}$ such that the nth iteration $f^{n(u)} (u) =0.$
Is this true that there exists $m\in\mathbb{N}$ such that for all $t\in [0,1]$ we have $f^m (t) =0$?
 A: The answer to the question is true. The solution I've found is messy and a bit tedious, but the trick here is to keep trying to find a fixed point which is not $0$.
First we define a function $m : [0,1]\rightarrow\mathbb{N}$ so that $m(u)$ is the least integer that $f^{m(u)}(u)=0$.
From $f^{m(1)}(1)=0$, $f(1)\neq1$ so $f(1)<1$.
Step 1.
If $f(0)>0$, then applying the intermediate theorem on the function $f(x)-x$ (at $x=0,1$), we have $f(c)-c=0$ for some $c\in(0,1)$ which is a contradiction because $f^{m(c)}(c)=0$. Therefore we have $f(0)=0$.
Step 2.
If $f(x_0)>x_0$ for some $x_0\in (0,1]$, again by the intermediate theorem (on $f(x)-x$ at $x=x_0, 1$) we get contradiction. And obviously $f(x_0)\neq x_0$ so $f(x)<x$ for all $x$ except $0$.
Step 3. Fix $0<\epsilon<1$ and put $c=\inf_{x\in[\epsilon, 1]}(x-f(x))$.
If $c=0$, There exist a sequence $\{x_n\}$ with each $x_n$ in $[\epsilon,1]$ and $x_n-f(x_n)$ converging to $0$ as $n$ tends to infinity. Then, by the Bolzano-Weierstrass theorem, there is a subsequence $\{x_{n_k}\}$ that converges to some $d>\epsilon$. From the continuity of $f$, $f(d)=d$ which is a contradiction to $f^{m(d)}(d)=0$. So $c>0$.
Step 4.
By the definition of $c$, $x-f(x)\geq c$ for $x\in[\epsilon, 1]$. So if $f^n(x)\geq\epsilon$, $x-f^n(x)\geq cn$ by step 2. But from step 3, $c>0$ so $f^n(x)<\epsilon$ if $n>1/c$.
Now assume that the problem is false and that $f$ is a counterexample. That means the function $m$ is not bounded.By step 4, $m$ must not be bounded in $[0,\epsilon]$. Which means that there exists $x$ in $[0,\epsilon]$ that $f(x)>0$ for every $\epsilon$. Since $\epsilon$ can be taken arbitrary, we can define a decreasing sequence $\{y_n\}$ that converges to $0$ which $f(y_n)=0$ but for every interval $(y_n,t)$, there existing some $x$ in the interval that $f(x)>0$.
Let $z_n=\sup_{x\in (y_{n+1},y_n)}f(x)$. Then $0<z_n<y_n$. Put $k_1=1$. Assume $k_n$ is defined and define $k_{n+1}$ as some integer $r>k_n$ that $y_r<z_{k_n}$. So $[y_{k_{n+1}+1},y_{k_{n+1}}]\subset [0,z_{k_n}]=f([y_{k_n+1},y_{k_n}])$. From this, $f^{n-1}([y_{k_1+1},y_{k_1}])\supset[y_{k_n+1},y_{k_n}]$.
Define(again!) sequence $\{a_n\}$ and $\{b_n\}$ as $y_{k_1+1}<a_n<b_n<y_{k_1}$ and $f^{n-1}([a_n,b_n])=[y_{k_n+1},y_{k_n}]$. By the nested interval theorem, there exist a $w$ that is in $[a_n,b_n]$ for all $n$.
Finally, because $f^{n-1}(w)\in f^{n-1}([a_n,b_n])=[y_{k_n+1},y_{k_n}]$, a set which does not include $0$, $f^n(w)\neq 0$ for all natural number $n$ which is a contradiction.
