I am trying to do this problem but could figure it out.
Show that $f(x) = \cos 2\pi x +\cos 2\pi \sqrt{2} x$ is almost-periodic by showing directly that given $\varepsilon > 0$ there exists an integer $M$ such that at least one of any $M$ consecutive integers lies within $\varepsilon$ from an integral multiple of $2\pi$.
The definition of almost periodic is based on the notion of relatively dense set.
A set $\mathcal{F}\subset \mathbb{R}$ is relatively dense in $\mathbb{R}$ if there exists a constant $L>0$ such that $(x,x+L)\cap F \neq \emptyset$ for all $x\in \mathbb{R}$. Then a bounded uniformly continuous function $f:\mathbb{R}\longrightarrow \mathbb{R}$ is "almost periodic" iff for any $\varepsilon >0$, the set $$ \mathcal{F}_\varepsilon = \left\lbrace h\in \mathbb{R}:\sup_{x\in > \mathbb{R}} \left|f(x+h) - f(x)\right| <\varepsilon \right\rbrace$$ is relatively dense in $\mathbb{R}$.
My attempt is based on the observation that for $m\in \mathbb{Z}$ then $$ f(x+m) - f(x) = \cos(2\pi \sqrt{2} x + 2\pi \sqrt{2}m) - \cos (2\pi \sqrt{2} x)$$ and thus $$ |f(x+m) - f(x)| \leq 2\pi\Big( \inf_{n\in \mathbb{Z}} \left|m\sqrt{2}+n\right| \Big)$$ We know that the set $\left\lbrace m\sqrt{2} + n: m,n\in \mathbb{Z}\right\rbrace$ is dense in $\mathbb{R}$ (by a simple Pidgeonhole argument). Thus the problem will be soved if we can show that for any $\varepsilon>0$, the set $$ \mathcal{F} = \left\lbrace m\in \mathbb{Z}: \;\text{there exists}\;n\in \mathbb{Z}\;\text{such that}\quad |m\sqrt{2}+n| < \varepsilon\right\rbrace$$ is "relatively dense" in $\mathbb{R}$, where relatively dense means there exists a constant $M_\varepsilon>0$ such that any interval $(x,x+M_\varepsilon)$ contains at least one element of $\mathcal{F}$.
This somehow relates to the problem of approximation $\sqrt{2}$ by rational numbers $\frac{p}{q}$ but we want the set of $q$ is relatively dense. One well-known result is the Dirichlet approximation theorem, which states that showing that any real number has a sequence of good rational approximations: in fact an immediate consequence is that for a given irrational $\alpha$, the inequality $$\left|\alpha - \frac{p}{q}\right| < \frac{1}{q^2}$$ is satisfied by infinitely many integers $p$ and $q$. But the problem how to control the distance between two consecutive denumerators still cannot be solved.
Can anyone help me? Thank you very much.