We produce a counterexample. Let
$$f(x)=\int_0^x g(t)\,dt,$$
where
$$g(t)=\frac{\sin(\ln((t+1))}{t+1}.$$
Then $f'(x)=g(x)$, and $\lim_{x\to\infty}g(x)=0$.
Integrate, making the substitution $u=\ln(t+1)$. Then
$$f(x)=\int_0^{\ln(x+1)} \sin u\,du=1-\cos(\ln(x+1)).$$
Then $f$ is bounded but does not have a limit as $x\to\infty$.
Remark: We could have just given the example $1-\cos(\ln(x+1))$, or left out the $1$ minus part. But in fact the example was found by first drawing a picture, and then turning that picture into an integral. It seemed better to give some indication of how the example was found than to just write it down.
For a somewhat simpler example, we can use $\sin(\sqrt{x+1})$.