Using Intermediate Value Theorem for continuous functions 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?
What would it take to modify $\sin x$ to make it satisfy $f(0) = f(1)$? Well, $\sin 0 = \sin \pi$, so how about
$$f(x) = \sin \left(\pi x\right)\,\text{?}$$

Now you just need to show that $$\sin \left(\pi x\right) \ne \sin \left(\pi x + \frac {2\pi}5\right)$$ for any $x \in [0, \frac 35]$, or equivalently, $$\sin x \ne \sin \left(x + \frac {2\pi}5\right)$$ for any $x \in [0, \frac{3\pi}5]$.

A little trig should give you a formula in the tangent satisfied by any $x$ for which the above is true. Show that the only solutions fall outside of $[0, \frac{3\pi}5]$ and you are done.
What would it take to modify $\sin x$ to make it satisfy $f(0) = f(1)$? Well, $\sin 0 = \sin \pi$, so how about
$$f(x) = \sin \left(\pi x\right)\,\text{?}$$

Now you just need to show that $$\sin \left(\pi x\right) \ne \sin \left(\pi x + \frac {2\pi}5\right)$$ for any $x \in [0, \frac 35]$, or equivalently, $$\sin x \ne \sin \left(x + \frac {2\pi}5\right)$$ for any $x \in [0, \frac{3\pi}5]$.

A little trig should give you a formula in the tangent satisfied by any $x$ for which the above is true. Show that the only solutions fall outside of $[0, \frac{3\pi}5]$ and you are done.