So I'm trying to find a solution to this question. In part (a), I have shown that for a function $\displaystyle f$ which is continuous on $\displaystyle [0,1]$ satisfying $\displaystyle f(0) = f(1)$ then for any number $\displaystyle n\in\mathbb{N}$ there is some $\displaystyle x\in[0,1-1/n]$ for which $\displaystyle f(x) = f(x+1/n).$ I did this by considering the function $\displaystyle g(x) = f(x) - f(x+1/n)$ and assuming $\displaystyle g(x) \neq 0$ for any $\displaystyle x.$ We can then show that either $\displaystyle f(1) > f(0)$ or $\displaystyle f(1) < f(0)$ by noting that, since $\displaystyle g$ is continuous we must have $\displaystyle g(x)<0$ or $\displaystyle g(x) > 0$ for all $\displaystyle x.$ So, in the latter case for example, we have $\displaystyle g(x) > 0 \quad \Rightarrow \quad f(0) > f(1/n) > f(2/n) > \ldots > f(1).$

This clearly relies on the fact that $\displaystyle n \cdot \frac{1}{n} = 1$ with $\displaystyle n\in\mathbb{N}.$

Now for part (b), which has me totally stumped. For $\displaystyle 0<a<1$ with $\displaystyle a \neq 1/n$ for any $\displaystyle n\in\mathbb{N},$ find a function $\displaystyle f$ continuous on $\displaystyle [0,1]$ satisfying $\displaystyle f(1) = f(0)$ for which $\displaystyle f(x) \neq f(x + a)$ for any $\displaystyle x \in [0,1-a].$ I just can't see how that could work. Imagine any function, and connect the points $\displaystyle (x,f(x))$ and $\displaystyle (x+a,f(x+a))$ with a straight line - surely if we have $\displaystyle f(0) = f(1)$ this line must be horizontal at some point!

How do I find such an $\displaystyle f$?