Show that $f(x+t)= f(x)$ Let $a, b \in R$ ($a<b$) and let $f: [a,b] \longrightarrow R$
a continuous function s.t. $f(a) = f(b)$.
I need to show that there exist $\delta > 0 \in R$ s.t.
$\forall t \in [0, \delta]    \exists x \in [a,b-t]$ that $f(x+t)= f(x)$
What I've done:  $f$ is continuous in the closed and bounded interval $[a,b]$, then $f$ must attain a maximum and a minimum so if the maximum is in the edges then we're done because $ f(a) = f(b)$. Otherwise it has to be within the interval. I want to take a $ \delta$ around the maximum and show that $f(x+t)= f(x)$ using the Intermediate value theorem.
Can you help me formalize it?
Thanks in advance!
 A: Let's suppose that $f$ is not constant so that it attains a global min or max in the interior (the result is trivial for constant $f$). Let us assume without loss of generality that there is a global maximum $f(x_0)=M$. 
I claim that $\delta = \min\{x_0-a,b-x_0\}$. For fixed $0 \le t \le \delta$, let us define the function
$$g(s) = f(x_0+s) - f(x_0-t+s),$$
for $0 \le s \le t$. Notice that $g$ is well defined since
$$a \le x_0 + s \le x_0 + t \le x_0 + \delta \le b,$$
and likewise
$$a \le x_0 - \delta \le x_0 - t \le x_0-t+s \le x_0 \le b.$$
When $s=0$, we have 
$$g(0) = f(x_0) - f(x_0 - t) \ge 0,$$
since $f(x_0) = M$ is the global maximum. Likewise, when $s=t$, we have
$$g(t) = f(x_0+t) - f(x_0) \le 0.$$
If ether inequality is an equality, then we have found a point $x_t$ such that $f(x_t) = f(x_t+t)$, namely $x_t=x_0$ or $x_t=x_0-t$. 
So suppose both inequalities are strict. Then by the intermediate value theorem, there must exist some $s_0$ for which $g(s_0) = 0$. Then our required point is $x_t=x_0+s_0-t$, for which 
$$g(s_0) = f(x_0+s_0) - f(x_0-t+s_0) = f(x_t + t) - f(x_t) = 0.$$
In either case, we have found our required $x_t$. Since we have done for this every $t\in [0,\delta]$, this completes the required proof.
