Prove that $f(x)$ be a constant

Take any $a, b \in \mathbb{R}$ such that $a < b$.

Since $f$ is continuous over $\mathbb{R}$, each $h_n$ is Lebesgue integrable over $[a,b]$. Since $h_n$ converges pointwise to $0$ and all $|h_n|$ are bounded by a constant $M$ (which is trivially Lebesgue integrable) over $[a,b]$. By Lebesgue's dominated convergence theorem,

$$\lim_{n\to\infty} \int_{a}^{b} h_n(x) dx = \int_{a}^{b} \lim_{n\to\infty} h_n(x) dx = \int_{a}^b 0\; dx = 0$$

Notice $$\int_{a}^{b} h_n(x) dx = 2^{n} \int_{a}^{b}\left( f(x+\frac{1}{2^n}) - f(x) \right) dx = 2^{n} \left( \int_{b}^{b+2^{-n}} f(x) dx - \int_{a}^{a+2^{-n}} f(x) dx \right)$$ and by continuity of $f$ at $a$ and $b$, we have:

$$\lim_{n\to\infty} 2^n \int_{a}^{a+2^{-n}} f(x)dx = f(a) \quad\text{ and }\quad \lim_{n\to\infty} 2^n \int_{b}^{b+2^{-n}} f(x)dx = f(b) $$ This implies $$f(b) - f(a) = \lim_{n\to\infty} \int_{a}^{b}h_n(x)dx = 0$$ and hence $f$ is a constant.


The condition $|h_n(x)|\le M$ is needless.

Given $\epsilon>0$, let $f_\epsilon(x)=f(x)+\epsilon x$ on $\mathbb{R}$. From

$$\lim_{n\to\infty}2^n(f_\epsilon(x+2^{-n})-f_\epsilon(x))=\epsilon>0,\quad \forall x\in\mathbb{R},$$ it is easy to see that $f_\epsilon$ is strictly increasing on $\mathbb{R}$. Letting $\epsilon\to 0$, it follows that $f$ is non-decreasing on $\mathbb{R}$. A similar argument also shows that $f$ is non-increasing on $\mathbb{R}$, which completes the proof.