# Intermediate value theorem with continuous function

Let $f: [0,1] \rightarrow \mathbb{R}$ be continuous with $f(0)=f(1)$. If $h \in (0,\frac{1}{2})$ is not of the form $\frac{1}{n}$, there does not necessarily exist $|x-y|=h$ satisfying $f(x)=f(y)$. Provide an example that illustrates this using $h=\frac{2}{5}$

I'm thinking I need to use some kind of modification to a sin function to get this to work. Not sure how to come up with an explicit formula, though. I could just draw a picture, but I want to find some explicit formula so I can show that it's true. A modified $\sin$ function could work, but I think it would be easier to reason using a piecewise linear function. Try defining a function like the one below. The $x$-intercepts are specifically chosen to be $0, \frac16, \frac13,\frac12,\frac23,\frac56,1$. What has to be true about $|x-y|$ if $f(x)=f(y)$? (If you really want to use $\sin$, then modify your $\sin$ function so that it has $x$-intercepts at the same places as this function. That should also work.) 