Here is the question from Spivak.
Suppose $0<a<1$ but $a \neq 1/n$ for any natural number n. Find a function $f$ that is 1.. continuous on $[0,1]$, 2. such that $f(0)=f(1)$, and (3) is such that $f(x) \neq f(x+a)$ for all $x$.
Here's the beginning of the answer from a previous thread (link to thread below). We know that $1/n+1 <a < 1/n$. It follows that $1-na \in [0,a]$. Let $f(ka + x) = kf(a) + f(x)$. A consequence of this, according to the answer in the thread below, is that $f(ka) = kf(a)$. I don't understand why this must be the case: why don't we have that $f(ka) = f(ka +0) = kf(a) + f(0)$.