A bounded continuous function $f : \mathbb{R} \to \mathbb{C}$ is almost periodic if for every $\epsilon>0$, there exists some $L>0$, such that every interval of $\mathbb{R}$ with length $\ge L$ contains some real number $T$ such that $\Vert f(\cdot+T)-f \Vert_\infty \le \epsilon$.
An equivalent definition is the relative compactness of the set of all functions $f(\cdot+T)$ with $T$ varying in $\mathbb{R}$ in the space of all continuous bounded functions endowed with $\Vert \cdot \Vert_\infty$.
It is necessary to have $$\liminf_{T \to \infty} \Vert f(\cdot+T)-f \Vert_\infty = 0.$$ Is it also sufficient?
My thought: the triangle inequality and the invariance of the norm $\Vert \cdot \Vert_\infty$ under translations show that the function $T \mapsto \Vert f(\cdot+T)-f \Vert_\infty$ is sub-additive on $\mathbb{R}_+$.