# If $f$ is differentiable and bounded and $\lim\limits_{x\to\infty}f'(x)=0$, does $\lim\limits_{x\to\infty}f(x)$ exists?

Let $f$ be differentiable and bounded, and $\lim\limits_{x\to\infty}f'(x)=0$. I want to know if $\lim\limits_{x\to\infty}f(x)$ exists.

It is easy (with MVT) to show that $\lim\limits_{x\to\infty}(f(x+1)-f(x))=0$, and other questions (e.g. here) show that $\lim\limits_{x\to\infty}\frac{f(x)}x=0$. My intuition says that $\lim\limits_{x\to\infty}f(x)$ should exist, but that does not mean anything.

Consider $f(x)=\sin(\ln x)$. $f'(x)=\frac{1}{x}\cos(\ln x)$. Now $f'(x)\to 0$ as $x\to\infty$, and $f(x)$ is bounded, but $\lim_{x\to\infty}f(x)$ does not exist.
The idea is that $\ln x$ goes to infinity, so $\sin(\ln x)$ will continue to oscillate, but $\lim_{x\to\infty} \frac{d}{dx}\ln x = 0$, and the derivative of $\sin(\ln x)$ is bounded by the derivative of $\ln x$.
To get a nicer counterexample function, say one that's defined on all of $\mathbb{R}$, and differentiable everywhere, we can choose a nicer function than $\ln x$, $g$, such that $\lim_{x\to\infty} g(x)=\infty$ but $\lim_{x\to\infty} g'(x)=0$. For example, let $h(x)=x^3+x$. $h$ is bijective, with derivative $3x^2+1$, so its inverse $g$ has derivative $\frac{1}{3x^2+1}$ satisfies the desired properties at infinity and is defined on $\mathbb{R}$ and differentiable everywhere. Thus with this definition of $g$, $\sin g(x)$ gives a nicer counterexample.