TITLE: Exercise about continuous functions
QUESTION [11 upvotes]: Consider a continuous function $f \, : \, [0,1] \, \longrightarrow \, [0,+\infty)$ such that $f(0)=f(1)=0$ and : $\forall x \in (0,1), \; f(x) > 0$. I would like to prove that there exist $x_{1},x_{2} \in [0,1]$ with $x_{1} < x_{2}$ and such that $f(x_{1}) = f(x_{2}) = x_{2}-x_{1}$.
If we assume that $x_{1}$ and $x_{2}$ exist, then let $a = x_{2}-x_{1} > 0$ and we see that the equation $f(x_{1})=f(x_{2})=a$ becomes : $f(x_{1}) = f(x_{1}+a) = a$. Therefore, $f(x_{1}) = f\big( x_{1}+f(x_{1}) \big)=a$. But I do not see how this will help me to find $x_{1}$.

REPLY [2 votes]: Extend $f$ to be $0$ outside the interval $[0,1]$, so that now it is defined on $\mathbb{R}$ (and is still continuous). Your requirement is equivalent to $x_2=x_1+f(x_1)$, $f(x_2)=f(x_1)>0$, $x_1,x_2\in [0,1]$.
So it suffices to find $x_1\in (0,1)$ such that $f(x_1+f(x_1))=f(x_1)$ (then putting $x_2:=x_1+f(x_1)$ we get $x_2>x_1$ and, since $f(x_2)=f(x_1)>0$, we get $x_2\in (0,1)$).
Thus we want to find a zero of $s(x):=f(x+f(x))-f(x)$. Clearly $s(\overline{x})\le 0$ at the point $\overline{x}\in (0,1)$ which realizes the maximum of $f$. But by continuity you can find $z\in (0,1)$ such that $z+f(z)=\overline{x}$ (since $x\mapsto x+f(x)$ fixes $0$ and $1$), so you also get $s(z)=f(\overline{x})-f(z)\ge 0$. Thus, again by continuity, $s$ must have a zero between $\overline{x}$ and $z$.