# An example of almost periodic function

"I need a continuous almost periodic function $f(x)$ such that $f(x)$ exists as $x$ tends to infinity. But this function should not be constant, which is a trivial example."

Definition of almost periodic function :

http://mathworld.wolfram.com/AlmostPeriodicFunction.html

We took standart metric on $\mathbb{R}$ i.e. $d(x,y)=|x-y|$

Examples of almost period function : (but $\lim_{t\to\infty}f(t)$ does not exist) $$f(t)=\frac{cost}{2+cos\sqrt2t}\quad,\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 that almost periodic functions also have the same property?(From uniform convergence)

The definition quickly implies that a nonconstant almost periodic function $f$ cannot have a limit at infinity. Indeed, pick $a,b$ such that $f(a)\ne f(b)$. Fix $\epsilon>0$ such that $$|f(a)-f(b)|>3\epsilon\tag{1}$$ Let $\ell=\ell(\epsilon)$ be as in the definition. Then for every integer $n$ there exists $\tau_n\in [n, n+\ell]$ such that $$|f(a+\tau_n)-f(a)|<\epsilon,\qquad |f(b+\tau_n)-f(b)|<\epsilon\tag{2}$$ It follows from (1) and (2) that $$|f(a+\tau_n)-f(b+\tau_n)|>\epsilon \tag{3}$$ Since $a+\tau_n\to\infty$ and $b+\tau_n \to\infty$ as $n\to\infty$, it follows that $\lim_{x\to\infty }f(x)$ does not exist.