TITLE: Eventually almost periodic functions
QUESTION [7 upvotes]: Call a function $f: [0, \infty) \to \mathbb R$ eventually almost periodic with period $p > 0$ if for all $x \in [0, p)$, the sequence ${f(x + np)}_{n \in \mathbb N}$ converges.
Suppose $f: [0, \infty) \to \mathbb R$ is continuous and eventually almost periodic of periods $1$ and $a$, where $a$ is irrational and $0 < a < 1$. Define $F: [0, 1) \to \mathbb R$ by $F(x) := \lim_{n \to \infty} f(x + n)$.  Is $F$ necessarily constant?

REPLY [8 votes]: $F$ must be constant. Consider an $\epsilon>0.$
The sets $$C_N=\{x\in[0,a)\mid |f(x+an)-f(x+am)|\leq \epsilon/3\text{ for all }n,m\geq N\}$$ are closed and cover $[0,a),$ so by the Baire category theorem there is an interval $[c,d]\subset C_N$ for some $0<c<d<a$ and some $N.$ Shrinking the interval $[c,d]$ if necessary we can ensure that
$$f([c,d]+aN) \in [t-\epsilon/3,t+\epsilon/3].\phantom{for all in x in [c,d]}$$ This implies that
$$\lim_{m\to\infty}f(x+am)\in [t-2\epsilon/3,t+2\epsilon/3]\text{ for all } x\in[c,d],$$
which gives
$$\phantom{abcdefghi}f(x+an)\in[t-\epsilon,t+\epsilon]\text{ for all }x\in[c,d]\text{ and }n\geq N.$$
But for any $x\in[0,1)$ the sequence $x+n$ lies in the set $[c,d]+a\mathbb N$ infinitely often, giving
$$\lim_{n\to\infty}f(x+n)\in [t-\epsilon, t+\epsilon]\text{ for all }x\in[0,1).\phantom{abc}$$ So $\sup F-\inf F\leq 2\epsilon$ for all $\epsilon,$ which means $F$ is constant.