I'm posting this answer because the proof given in the paper by Miller and Vyborny contains a little mistake. What follows is a revised version of their proof.
Assume by contradiction that $f(a)\neq f(b)$ for some $a<b$. We can assume $f(a)<f(b)$ (otherwise replace $f$ by $-f$), $f(a)=0$ (replace $f(x)$ by $f(x)-f(a)$) and $f(b)=1$ (observe that now $f(b)>f(a)=0$ and replace $f(x)$ by $\frac{1}{f(b)}f(x)$).
We can also suppose that $a=0$ (replace $f(x)$ by $f(x+a)$) and $b=1$
(replace $f(x)$ by $f(bx)$). Clearly none of these operations alters the hypothesis. These silly reductions were not necessary, but it is often instructive to see how one can simplify notation for free (via translating/rescaling tricks).
So $f(0)=0$ and $f(1)=1$. Now the core of the proof: define $g(x):=\frac{1}{3}+\frac{x}{3}$ and notice that $g(0)>f(0)$ and $g(1)<f(1)$.
Thus $A:=\{x\in [0,1]: g(x)>f(x)\}$ is nonempty.
Put $x_0:=\sup A>0$. By continuity we have $g(x_0)\ge f(x_0)$, so $x_0<1$.
Since, for any $0<\epsilon<1-x_0$, $x_0+\epsilon\not\in A$, we deduce
$g(x_0+\epsilon)\le f(x_0+\epsilon)$ and so, again by continuity,
$g(x_0)\le f(x_0)$. So finally $g(x_0)=f(x_0)$.
Now there are two cases: if the right derivative at $x_0$ exists and is $0$,
then for $\epsilon>0$ sufficiently small we have $\frac{f(x_0+\epsilon)-f(x_0)}{\epsilon}<\frac{1}{3}$, i.e.
$$f(x_0+\epsilon)<f(x_0)+\frac{\epsilon}{3}=g(x_0)+\frac{\epsilon}{3}=g(x_0+\epsilon),$$ which contradicts the fact that $x_0+\epsilon\not\in A$.
If instead the left derivative at $x_0$ exists and is $0$ then for $\epsilon>0$ sufficiently small, say $0<\epsilon\le \epsilon_0$, we have
$\frac{f(x_0)-f(x_0-\epsilon)}{\epsilon}<\frac{1}{3}$, i.e.
$$f(x_0-\epsilon)>f(x_0)-\frac{\epsilon}{3}=g(x_0)-\frac{\epsilon}{3}=g(x_0-\epsilon).$$ So $x_0-\epsilon\not\in A$. But we also know
that $x_0\not\in A$ (this was not guaranteed in the paper referenced above and led to an incomplete proof). Hence $A\cap [x_0-\epsilon_0,x_0]=\emptyset$, contradicting the fact that $x_0=\sup A$. This completes the proof.