Find the solution of the functional equation $f\colon ℝ\to ℝ\:$
$$f\left(x\right)+a=f\left(x+b\right), \quad\forall x\in\mathbb{R}$$
where $a$ and $b$ are fixed real numbers and $b$ is a positive real number.
I suppose that the answer is $$f\left(x\right)=cx+d+g\left(x\right)$$ for every $x$ real number, where $g\left(x\right)$ is a periodic function. I found by induction that $$f\left(x\right)+ka=f\left(x+kb\right)$$ for every $x$ real number and $k$ integer. However I could not find a complete proof for this. Can somebody help me out?
We may assume that $b\ne0$, since otherwise the condition is trivial. Let $g(x)=f(x)-\frac abx$. From the functional equation, we have that $g(x+b)=f(x+b)-\frac abx-a=g(x)$, so that $g$ has period $b$.
The converse is also easily proven to be true. That is, every function $f$ satisfying the equation is of the form $g(x)+\frac abx$ for some function $g$ with period $b$.