Let $f \colon [0,2] \to \Bbb R$ be a continuous function such that $f(0) = f(2)$. Use the intermediate value theorem to prove that there exist numbers $x, y \in [0, 2]$ such that $f (x) = f (y)$ and $|x − y| = 1$.
Hint: Introduce the auxiliary function $g \colon [0, 1] \to \Bbb R$ defined by $g(x) = f (x + 1) − f (x)$.
I still do not know how to prove it. Could anyone help?