# Continuous function s.t. $\lim_{n\to \infty }f(nx)=0$ for all $x$, but not $\lim_{x\to \infty }f(x)$.

I had an exercise that was : if $f:\mathbb R\longrightarrow \mathbb R$ is uniformly continuous and if $$\lim_{n\to \infty }f(nx)=0$$ for all $x$, then $\lim_{x\to \infty }f(x)=0$. I proved this result, but I was wondering why it doesn't work if $f$ is just supposed continuous. I can't find a counter example, any idea ?

• I believe it works for continuous functions too, but probably requires a different approach. Is there any reason you're saying that it doesn't work for continuous functions or is it simply because it doesn't say so in the exercise? May 10 '18 at 15:32
• @JustDroppedIn : I belive that it doesn't work, because I suppose that we wouldn't need the strongest hypothesis of uniformly continuous... but maybe it hold for continuous function too... May 10 '18 at 15:34
• I believe this is a Baire category theorem application.... I'm searching.
– user123641
May 10 '18 at 15:40
• – user123641
May 10 '18 at 15:41
• math.stackexchange.com/questions/101086/…
– user123641
May 10 '18 at 15:42

I think it is true for continuous functions too: Let $\varepsilon>0$. Let's consider the sets $A_n=\{x\in\mathbb{R}: |f(nx)|\leq\varepsilon\}$. Since $f$ is continuous, the sets $A_n$ are closed (preimages of closed sets under $f$ composed with other continuous functions). Also, let $B_n=\displaystyle{\bigcap_{k=n}^{\infty}A_k}$. These are also closed sets and the union $\bigcup_nB_n$ is $\mathbb{R}$, since for all $x\in\mathbb{R}$ it is $f(nx)\to0$. By Baire's category theorem, there exists $n_0$ such that $int(B_{n_0})\neq\emptyset$. Therefore there exists $x_0$ and $r>0$ such that for all $n\geq n_0$ and all $y\in(x_0-r,x_0+r)$ it is $|f(ny)|\leq\varepsilon$. That being said, for all $z\in\displaystyle{\bigcup_{n=n_0}^\infty}(n(x_0-r),n(x_0+r))$ it is $|f(z)|\leq\varepsilon$.
If $x_0+r>0$, we're done, since the last union will cover a whole interval of the form $(s,+\infty)$.