Out of curiosity, I was wondering whether if a continuous function $f:\mathbb{R}\rightarrow\mathbb{R}$ has the property that in any 2 intervals $[a,b]$ and $[c,d]$ on which it is defined, $(a-b = c -d) \implies (f(a)-f(b) = f(c)-f(d))$, then the graph of this function is a straight line.
So far, I have tried reasoning the contrapositive of this- that not being a straight line means there exist intervals of equal length where the function changes a different amount over them. While this seemed more intuitive, I didn't see a rigorous way to prove this.
So is this claim true, and if so, what is the proof?