With the condition $\lim_{x\to \infty}(f(x+a)-f(x))=0$, how to construct $h(x)$? Assume $f(x)\in C[0,+\infty)$，and for all $a\geqslant 0$, we have
\begin{align*}
\lim_{x\to \infty}(f(x+a)-f(x))=0 \tag{*}.
\end{align*}
Prove that there exists $g(x)\in C[0,+\infty)$ and $h(x)\in C^1[0,+\infty)$ such that $f(x)=g(x)+h(x)$, and such that they satisfy
\begin{align*}
\lim_{x\to \infty}g(x)=0,~~\lim_{x\to \infty}h'(x)=0.
\end{align*}
My thought is let $h(x)=\frac1 a\int_x^{x+a}f(t)\,dt$, then it is easy to see $\lim_{x\to \infty}h'(x)=0$, but I can't explain that $\lim_{x\to \infty}g(x)=\lim_{x\to \infty}f(x)-h(x)=0$.  It seems we should try proving  $\lim_{x\to +\infty}f(x)$ exists by using the condition of (*), but I'm not sure whether it's true or false.
 A: EDIT : I'm assuming uniform continuity here, so my proof only works in that case.
Let's chose $a = 1$ and set $h(x) = \int_x^{x+1} f(t) \, dt$. We begin by writing 
$$h(x)-f(x) = \int_0^{1} (f(x+t)-f(x)) \ dt$$
The integrand converges to $0$ pointwise (from condition (*)), but this is not quite sufficient ! We'll have to be a bit more careful and also use the uniform continuity of $f$.
Let $\epsilon > 0$. Because $f$ is uniformly continuous, there exists an integer $n > 0$ such that for all $x,y \ge 0]$ with $|x-y|\le \frac{1}{n}$, we have $|f(x)-f(y)| \le \epsilon$.
Now we use condition (*) to get that for $1 \le k \le n$, there exists $x_k$ such that for all $x \ge x_k$,
$$\left|f\left(x+\frac{k}{n}\right)-f(x)\right| \le \epsilon$$
We set $x_0 = max_{1 \le k \le n}(x_k)$. Now, for $x \ge x_0$ we have 
$$\begin{eqnarray*}
|h(x)-f(x)| &=& \left| \int_0^{1} (f(x+t)-f(x)) \ dt \right|\\
&\le& \int_0^{1} |f(x+t)-f(x)| \ dt \\
&\le& \sum_{k= 1}^{n} \int_{\frac{k-1}{n}}^{\frac{k}{n}} \underbrace{\left|f(x+t)-f\left(x+\frac{k}{n}\right)\right|}_{\le \epsilon \ \text{ (from continuity)}} + \underbrace{\left|f\left(x+\frac{k}{n}\right)-f(x)\right|}_{\le \epsilon \ \text{ (from (*))}} \ dt \\
&\le& 2 \epsilon
\end{eqnarray*}$$
