Does $f(x+1)-f(x)$ constant imply $f$ is linear? I have a function $f:\mathbb R\to \mathbb R$ and $f$ doesn’t have any restriction, so it might not be continuous and so on. If the condition $$f(x+1)-f(x)=c$$
holds $\forall x\in \mathbb R$, does that mean $f$ is linear?
If not why this textbook say this?

This is a solution to the IMO Shortlist 2015 A2 which says Find all $f:\mathbb Z \to \mathbb Z$ s.t. $$f(x-f(y))=f(f(x))-f(y)-1$$
 A: This answer will rather be a compilation of the comments. The short answer is no.
First, let's take a look at the case $c = 0$. Then, $f(x+1)-f(x) = 0,\ \forall x\in\mathbb R,$ which is a definition of a periodic function with period $1$. In the comments there are couple of suggestions:

*

*$f(x) = \sin (2\pi x)$ which is even smooth, but still not linear. (David Mitra)

*$f(x) = \begin{cases}1,\, x\in\mathbb Z\\ 2,\,\text{otherwise}\end{cases},$ which is not continuous, yet periodic, since $x+1$ and $x$ are either both integers or both non-integers and therefore $f(x+1) = f(x).$ (TheBestMagician)

*$f(x) = x - \lfloor x \rfloor$ which gives us the fractional part of real $x$. Its graph is sawtooth wave. It is periodic with period $1$ since $\lfloor x + 1 \rfloor = \lfloor x \rfloor +1$ for any real $x$.

For the case when $c\neq 0$, the easiest counterexample that came to mind and which I mentioned in the comments is $f(x) = c\lfloor x \rfloor$. Using the fact $\lfloor x + 1\rfloor = \lfloor x \rfloor + 1$ again, you can easily check that $f(x+1)-f(x) = c$. If $c = 1$, you can take a look at the graph of $f$ here.
To find more counterexamples, we can follow hint from Will Jagy in the comments and define function $g(x) = f(x)-cx$. It is easy to check that $g(x+1)-g(x) = 0$ and therefore $g$ is periodic function with period $1$. Therefore, all $f$ that satisfy your condition are of the form $$f(x) = cx + g(x)$$ where $g$ is periodic with period $1$. We can also conclude that $f$ is linear if and only if $g$ is constant. Since almost all periodic functions are not constant, almost all $f$ are nonlinear. This is also suggested in the comment by Thomas Andrews since for any $g$ defined on $[0,1)$ you can define $\tilde{g}(x) = g(x-\lfloor x\rfloor)$ and $\tilde g$ will be periodic with period $1$.

It's perhaps worth noting that $f(x+h)-f(x) = c$ will similarly fail for any fixed $h$, you just replace periodic functions with period $1$ with periodic functions with period $h$ in the above discussion. If you wanted to make sure $f$ is linear, you need much stronger condition like $$f(x+h)-f(x) = ch,\ \forall x\in\mathbb R,\, \forall h\in\mathbb R$$ which will make sure that $$\lim_{h\to 0}\frac{f(x+h)-f(x)}{h} = c,$$ i.e. $f$ is differentiable on all $\mathbb R$ and its derivative is constant. This does imply that $f(x) = cx + d$ for some constant $d$.
EDIT: Or, simply note that $f(x+h)-f(x) = ch$ for all $x,h\in\mathbb R$ implies $f(h)-f(0) = ch$ for all $h\in\mathbb R$.
