A solution for $f(ax+b)=f(x)+1$ Let $a,b$ be two constant real numbers with $a\neq 0$. Can anyone give a special solution of the functional equation  $f(ax+b)=f(x)+1$, where $f:\mathbb{R}\rightarrow \mathbb{R}$?
Note. It is a type of the Abel functional equations, and if $a=1$, then
$f(x)=[\frac{x}{b}]$ is an its solution.

For fixed $a\in\mathbb{R}\setminus\{1\}$ and $b\in\mathbb{R}$, let now consider a function $f:\mathbb{R}\to\mathbb{R}$ which satisfies the functional equation
$$f(ax+b)=f(x)+1\text{ for all }x\in\mathbb{R}\setminus\left\{\frac{b}{1-a}\right\}\,.\tag{#}$$
Firstly, we assume that $a=0$.  Then, we see that $f(x)=f(b)-1$ for any $x\in\mathbb{R}\setminus\{b\}$.  Thus, all functions $f:\mathbb{R}\to\mathbb{R}$ with the condition (#) are of the form
$$f(x)=\begin{cases}c&\text{if }x=b\,,\\c-1&\text{if }x\neq b\,.\end{cases}$$

Secondly, we assume that $a>0$.  Write $I^+:=\left(\dfrac{b}{1-a},+\infty\right)$ and $I^-:=\left(-\infty,\dfrac{b}{1-a}\right)$.  For $x\in I^+$, we can see that
$$x-\frac{b}{1-a}=a^t\text{ or }t=\frac{\ln\left(x-\frac{b}{1-a}\right)}{\ln(a)}$$
for some $t\in\mathbb{R}$.  Thus, if $g_+(t):=f\left(a^t+\dfrac{b}{1-a}\right)$ for each $t\in\mathbb{R}$, then
$$\begin{align}g_+(t+1)&=f\left(a^{t+1}+\frac{b}{1-a}\right)=f\Biggl(a\left(a^t+\frac{b}{1-a}\right)+b\Biggr)\\&=f\left(a^t+\frac{b}{1-a}\right)+1=g_+(t)+1\,.\end{align}$$
Therefore, if $h_+(t):=g_+(t)-t$, then $h_+:\mathbb{R}\to\mathbb{R}$ is periodic with period $1$.  That is,
$$f(x)=h_+\left(\frac{\ln\left(x-\frac{b}{1-a}\right)}{\ln(a)}\right)+\frac{\ln\left(x-\frac{b}{1-a}\right)}{\ln(a)}\text{ for all }x\in I^+\,.$$
We obtain a similar result for $x\in I^-$.  Thus,
$$f(x)=\begin{cases}
h_+\left(\frac{\ln\left(x-\frac{b}{1-a}\right)}{\ln(a)}\right)+\frac{\ln\left(x-\frac{b}{1-a}\right)}{\ln(a)}&\text{if }x>\frac{b}{1-a}\,,\\
c&\text{if }x=\frac{b}{1-a}\,,\\
h_-\left(\frac{\ln\left(\frac{b}{1-a}-x\right)}{\ln(a)}\right)+\frac{\ln\left(\frac{b}{1-a}-x\right)}{\ln(a)}&\text{if }x<\frac{b}{1-a}\,,
\end{cases}$$
where $h_+,h_-:\mathbb{R}\to\mathbb{R}$ are periodic functions with period $1$, and $c\in\mathbb{R}$ is an arbitrary constant.

Finally, we are dealing with the case $a<0$.  We rule out the case $a=-1$, since there does not exist a solution $f$ with the said property.  This is because of the contradiction below when $a=-1$:
$$f(x)=f\big(-(-x+b)+b\big)=f(-x+b)+1=\big(f(x)+1\big)+1=f(x)+2$$
for all $x\neq \dfrac{b}{2}$.  From now on, we assume that $a\neq -1$.  
Note that
$$\begin{align}f\big(a^2x+(a+1)b\big)&=f\big(a(ax+b)+b\big)=f(ax+b)+1\\&=\big(f(x)+1\big)+1=f(x)+2\end{align}$$
for all $x\neq \dfrac{b}{1-a}$.  Let $A:=a^2$, $B:=(a+1)b$, and $\phi(t):=\dfrac{1}{2}\,f(t)$ for all $t\in\mathbb{R}$.  Then,
$$\phi(Ax+B)=\phi(x)+1$$
for every $x\neq \dfrac{b}{1-a}=\dfrac{B}{1-A}$.  Since $A>0$ and $A\neq 1$, we have by the previous section of this answer that
$$\phi(x)=\begin{cases}
\eta_+\left(\frac{\ln\left(x-\frac{B}{1-A}\right)}{\ln(A)}\right)+\frac{\ln\left(x-\frac{B}{1-A}\right)}{\ln(A)}&\text{if }x>\frac{B}{1-A}\,,\\
C&\text{if }x=\frac{B}{1-A}\,,\\
\eta_-\left(\frac{\ln\left(\frac{B}{1-A}-x\right)}{\ln(A)}\right)+\frac{\ln\left(\frac{B}{1-A}-x\right)}{\ln(A)}&\text{if }x<\frac{B}{1-A}\,,
\end{cases}$$
where $\eta_+,\eta_-:\mathbb{R}\to\mathbb{R}$ are periodic functions with period $1$, and $C\in\mathbb{R}$ is an arbitrary constant.  Therefore,
$$f(x)=2\,\phi(x)=\begin{cases}
2\,\eta_+\left(\frac{\ln\left(x-\frac{b}{1-a}\right)}{2\,\ln|a|}\right)+\frac{\ln\left(x-\frac{b}{1-a}\right)}{\ln|a|}&\text{if }x>\frac{b}{1-a}\,,\\
c&\text{if }x=\frac{b}{1-a}\,,\\
2\,\eta_-\left(\frac{\ln\left(\frac{b}{1-a}-x\right)}{2\,\ln|a|}\right)+\frac{\ln\left(\frac{b}{1-a}-x\right)}{\ln|a|}&\text{if }x<\frac{b}{1-a}\,,
\end{cases}$$
where $c:=2C$.
Recall that $f(ax+b)=f(x)+1$ for $x\neq \dfrac{b}{1-a}$.  For $x>\dfrac{b}{1-a}$, we have
$$f(ax+b)=f(x)+1=2\,\eta_+\left(\frac{\ln\left(x-\frac{b}{1-a}\right)}{2\,\ln|a|}\right)+\frac{\ln\left(x-\frac{b}{1-a}\right)}{\ln|a|}+1\,.\tag{1}$$
Because $ax+b<\dfrac{b}{1-a}$ when $x>\dfrac{b}{1-a}$, we conclude that
$$f(ax+b)=2\,\eta_-\left(\frac{\ln\left(\frac{b}{1-a}-(ax+b)\right)}{2\,\ln|a|}\right)+\frac{\ln\left(\frac{b}{1-a}-(ax+b)\right)}{\ln|a|}\,.$$
Since $\dfrac{b}{1-a}-(ax+b)=|a|\,\left(x-\dfrac{b}{1-a}\right)$, we obtain
$$f(ax+b)=2\,\eta_-\left(\frac{\ln\left(x-\frac{b}{1-a}\right)}{2\,\ln|a|}+\frac{1}{2}\right)+\frac{\ln\left(x-\frac{b}{1-a}\right)}{\ln|a|}+1\,.\tag{2}$$
Equating (1) and (2), we conclude that
$$\eta_+\left(t\right)=\eta_-\left(t+\frac{1}{2}\right)\text{ for each }t\in\mathbb{R}\,.$$
Let $h:\mathbb{R}\to\mathbb{R}$ be given by
$$h(t)=2\,\eta_+\left(\frac{t}{2}\right)\text{ for every }t\in\mathbb{R}\,.$$
Ergo, $h$ is periodic with period $2$ and
$$h(t-1)=2\,\eta_-\left(\frac{t}{2}\right)\text{ for every }t\in\mathbb{R}\,.$$
Hence,
$$f(x)=\begin{cases}
h\left(\frac{\ln\left(x-\frac{b}{1-a}\right)}{\ln|a|}\right)+\frac{\ln\left(x-\frac{b}{1-a}\right)}{\ln|a|}&\text{if }x>\frac{b}{1-a}\,,\\
c&\text{if }x=\frac{b}{1-a}\,,\\
h\left(\frac{\ln\left(\frac{b}{1-a}-x\right)}{\ln|a|}-1\right)+\frac{\ln\left(\frac{b}{1-a}-x\right)}{\ln|a|}&\text{if }x<\frac{b}{1-a}\,,
\end{cases}$$
for some real constant $c$ and for some periodic function $h:\mathbb{R}\to\mathbb{R}$ with period $2$.

It is not difficult to prove that the three results are indeed solutions to (#).  I shall omit the proof of this part as an exercise.
