Let $f: [0,1] \rightarrow \mathbb{R}$ be continuous with $f(1)=f(0)$. Prove that if $h\in \left(0,\frac{1}{2}\right)$ is not of the form $\frac{1}{n}$, then there does not necessarily exist $|x-y|=h$ satisfying $f(x)=f(y)$. Provide an example that illustrates this using $h=\frac{2}{5}$.
So I was given the hint that I can use a modified $sin$ function, however I'm not really sure how I would go about that. Preferably, an example not using that would be great.
My thoughts so far are that I use a proof by contradiction saying that $\exists$ $x,y\in[0,1]$ such that $f(x)=f(0)$ and $|x-y|=h$. And I need to get to the point where $h=\frac{1}{n}$, which would create the contradiction (I assume that's the endpoint?). However, how would I use $h=\frac{2}{5}$ to prove that? Is it trivial in that $h=\frac{1}{n}$ is false? Also, it isn't given that $n\in \mathbb{N}$, so maybe I shouldn't assume that?