Proving analytical statement, Intermediate Value Theorem Let's define $f$ as a continuous function with $f:[0;2] \to \mathbb{R}$ and $f(0) = f(2)$.
Now, I want to show that:
$$\exists x_0 \in [0;1]:f(x_0) = f(x_0 + 1)$$
I tried to plot a few functions in order to construct a counterexample, but it seems that this statement really is true.
Unfortunately, I don't think I'm entirely sure why this works, yet. My current guess is that it has something to do with the Intermediate Value Theorem, as $f$ is continuous. In other words: If our function value 'goes up', it'll have to 'come back down' eventually (and vice versa), since it still needs to fulfill $f(0)=f(2)$.
Can someone help me prove this statement?
 A: Consider the following function on $[0,1]$,
$$g(x) = f(x+1) - f(x)$$
where we assume $f(0) = f(2)$. We'd like to show there is some $x_0 \in [0,1]$ such that $g(x_0)=0$. So if we can show $g(x) >0$ on some interval and $g(x) <0$ somewhere as well, since $g(x)$ is continuous it must pass $0$. This is the context of the intermediate value theorem. So let's consider $x=0$ and $1$, we see that 
$$ g(0) = f(1) -f(0) \quad \& \quad g(1) = f(2) -f(1) = f(0) - f(1) = -g(0) $$
Thus we see that $g(x)$ does indeed change sign. So by the intermediate value theorem we know that it must be zero somewhere. 
A: 
Define $$g(x)=f(x)-f(x+1)$$ for $x$ in $[0,1$] then you have that in 0 is positive but in 1 is negative and then by the MVT is done.

A: 
$f$ is a continuous function $f\colon [0;n] \to \mathbb{R}$, $f(0) = f(n)$

then there are $(x_i,y_i)(i=1,2,\dotsc,n)$ such that $y_i-x_i $ is  positive integer,and $f(x_i) = f(y_i)$.


One way is mathematical induction 
$g(x) = f(x+1) - f(x)$
there is $\epsilon$ such that $g(\epsilon) = 0$. Consider
$$\begin{equation}h(x)=\begin{cases}f(x)& 0\leq x\leq\epsilon\\f(x+1)&\epsilon\lt x\leq n\end{cases}\end{equation}$$
now $h(0)=h(n)$
