Problem: Let $f$ be a function that is uniformly continuous on $[0,+\infty)$, and for any $x \in [0,+\infty)$, it satisfies $ \lim _{n \rightarrow+\infty} f(x+n)=0, \quad n \text { is a positive integer. } $
Prove that $\lim _{x \rightarrow+\infty} f(x)=0$.
My solution: First, by uniform continuity, for any $\epsilon > 0$, there exists $\delta > 0$ such that for any $x', x'' \in [0,+\infty)$ satisfying $\left|x'-x''\right| < \delta$, we have $ \left|f\left(x'\right)-f\left(x''\right)\right| < \frac{\epsilon}{2} \text{.} $
For the above $\delta > 0$, let $ M=\left[\frac{2}{\delta}\right]+1, \text{ and } x_i=\frac{i}{M}, i=0,1, \cdots, M, $
then $ [0,1] \subset \bigcup_{i=0}^M\left(x_i-\delta, x_i+\delta\right) \text{.} $
On the other hand, from the given condition, for the above $\epsilon$, there exists a positive integer $N$ such that for $n > N$, we have $ \left|f\left(x_i+n\right)\right| < \frac{\epsilon}{2}, \quad \forall i=0,1, \cdots, M \text{.} $
Therefore, when $x > N+1$, we can decompose $x=[x]+\{x\}$, where the integer part $[x] \geq N+1$ and the fractional part $\{x\} \in [0,1)$. Thus, there must exist $i \in \{0,1, \cdots, M\}$ such that $ \{x\} \in \left(x_i-\delta, x_i+\delta\right) \cap [0,1] \quad \Longrightarrow \quad \left|x-[x]-x_i\right| < \delta \text{.} $
Hence, $ |f(x)| \leq \left|f(x)-f\left(x_i+[x]\right)\right| + \left|f\left(x_i+[x]\right)\right| < \frac{\epsilon}{2} + \frac{\epsilon}{2} = \epsilon \text{.} $
This implies that $ \lim _{x \rightarrow+\infty} f(x) = 0 $.
And I found a similar problem:A classical problem about limit of continuous function at infinity and its connection with Baire Category Theorem
I would like to know if the problem I just solved is related to the Baire category theorem. If we weaken the condition of uniform continuity to continuity, does the proposition still hold, or are there counterexamples?