Constructing a continuous function whose graph seems 'special' I've been reading through Zorich's "Analysis I" book recently, and I came across this nice little exercise.
Let $f: [0,1]\to \mathbb R$ be a continuous function such that $f(0)=f(1)$. Show that 


*

*for any $n\in \mathbb N$ there exists a horizontal closed interval of length $\frac 1n$ with endpoints on the graph of this function;

*if the number $\ell$ is not of the form $\frac 1n$ there exists a function of this form on whose graph one cannot inscribe a horizontal chord of length $\ell$.
The first part can be proven like this:
Consider $g: [0,(n-1)/n] \to \mathbb R$ given by $g(x) = f(x) - f(x+1/n)$. Then 
$$\sum_{k=0}^{n-1} g(k/n) = 0$$
and therefore either all of these points are zero or there exists both a point where $g$ is positive and a point where $g$ is negative. By continuity, there must then also be a point where $g = 0$. So we are done.
Now, the second statement seemed rather counterintuitive, and I have given it some time now, but don't see a counterexample for $\ell < 1/2$.
(For $\ell > 1/2$ the function $f(x) = \sin(2\pi x)$ will do.)
Can anyone help me out?
Cheers,

Try $f(x) = \sin^2(\pi x/\ell) - x \sin^2(\pi/\ell)$
