Let $f:[0,1] \to \mathbb{R}$ be continuous, and assume $f(0)=f(1)$. Define $g:[0,1-\frac{1}{n}]$ by $g(x)=f(x)-f(x+\frac{1}{n})$. We want to show that there exists some $c \in [0,1-\frac{1}{n}]$ such that $g(c)=0$.
Assume by contradiction that there doesn't exist such $c$, so $g>0$ or $g<0$ (This is because $g$ is continuous; if there exist some $x_1,x_2$ such that $g(x_1)>0$ and $g(x_2)<0$, then by the intermediate value theorem there exists some $c$ such that $g(c)=0$); We assume wlog that $g>0$. Note that $0
This is a contradiction.