"I need a continuous almost periodic function $f(x)$ such that $\lim_{x\to\infty}f(x)$ exists. But this function should not be constant, which is a trivial example."
Definition of almost periodic function: http://mathworld.wolfram.com/AlmostPeriodicFunction.html
We take the standard metric on $\mathbb{R}$, i.e., $d(x,y)=|x-y|$.
Examples of almost periodic functions: (but $\lim_{t\to\infty}f(t)$ does not exist) $$f(t)=\frac{\cos t}{2+\cos\sqrt2t}\ ,\quad f(t)=\sin2\pi t+ \sin2\pi t\sqrt2 ~.$$
On the other hand, page 69, paragraph 4 of the article http://projecteuclid.org/download/pdf_1/euclid.pjm/1102812425 says the following:
"Once Bohr established his fundamental theorem, he was able to show that any continuous almost periodic function is the limit of a uniformly convergent sequence of trigonometric polynomials. This is the main result of his second paper. The converse of this result was also true."
Since we know that for every non-constant periodic function $g(x)$ (or trigonometric function), $g(x)$ does not exist as $x$ tends to infinity, can we conclude (from uniform convergence) that almost periodic functions also have the same property?
Thanks your help.