Integer valued functions satisfying the functional equation $f(2x+1)=f(x)+1$ We are trying to find all functions $f:\mathbb{R}\setminus\{-1\}\to \mathbb{Z}$  satisfying the functional equation $$f(2x+1)=f(x)+1\text.$$
Note. It is easy to check that every function $f(x)$ of the form
$\left\lfloor T_1\left(\frac{\ln|x+1|}{\ln 2}\right)+\frac{\ln|x+1|}{\ln 2}\right\rfloor$, where $T_1$ is $1$-periodic, is a solution. Also, we can find an integer constant such that $f(1)=1+c$, $f(3)=2+c$, $f(7)=3+c$, $\dots$
(analogously for $f(-3)$, $f(-5)$, $f(-9)$, $\dots$).
Any idea?
 A: The general solution is almost the same as what you've found. The difference is that you need to split it to $ x < - 1 $ and $ x > - 1 $.
Define $ g : \mathbb R \to \mathbb R $ with $ g ( x ) = f ( 2 ^ x - 1 ) - x $. Then by substituting $ 2 ^ x - 1 $ for $ x $ in
$$ f ( 2 x + 1 ) = f ( x ) + 1 \tag 0 \label 0 $$
(which is valid for every $ x \in \mathbb R $ since $ 2 ^ x - 1 \in ( - 1 , + \infty ) $), you get
$$ g ( x + 1 ) = g ( x ) \text . \tag 1 \label 1 $$
Similarly, defining $ h : \mathbb R \to \mathbb R $ with $ h ( x ) = f ( - 2 ^ x - 1 ) - x $, you can substitute $ - 2 ^ x - 1 $ for $ x $ in \eqref{0} (again valid for every $ x \in \mathbb R $ since $ - 2 ^ x - 1 \in ( - \infty , - 1 ) $), and get
$$ h ( x + 1 ) = h ( x ) \text . \tag 2 \label 2 $$
\eqref{1} and \eqref{2}, and definitions of $ g $ and $ h $ tell us that $ f $ must be of the form
$$ f ( x ) = \begin {cases} \log _ 2 ( x + 1 ) + g \big( \log _ 2 ( x + 1 ) \big) & x > - 1 \\ \log _ 2 ( - x - 1 ) + h \big( \log _ 2 ( - x - 1 ) \big) & x < - 1 \end {cases} \tag 3 \label 3 $$
for some $ 1 $-periodic functions $ g $ and $ h $. As $ f ( x ) $ takes only integer values, you can rewrite \eqref{3} as $ f ( x ) = \left\lfloor \tilde f ( x ) \right\rfloor $ where
$$ \tilde f ( x ) = \log _ 2 | x + 1 | + \begin {cases} g \big( \log _ 2 | x + 1 | \big) & x > - 1 \\ h \big( \log _ 2 | x + 1 | \big) & x < - 1 \end {cases} \tag 4 \label 4 $$
Conversely, given any $ 1 $-periodic functions $ g $ and $ h $, if you define $ \tilde f $ with \eqref{4} and $ f $ with $ f ( x ) = \left\lfloor \tilde f ( x ) \right\rfloor $, you can see that it satisfies \eqref{0} (note that $ x \lessgtr - 1 $ iff $ 2 x + 1 \lessgtr - 1 $).
