TITLE: $f:(0,\infty)\rightarrow (0,\infty)$ is continuous, $\lim_{n\rightarrow\infty}f(nx)=0$ then $\lim_{x\rightarrow\infty}f(x)=0$
QUESTION [6 upvotes]: Could any one tell me how to solve this one?
$f:(0,\infty)\rightarrow (0,\infty)$ is continuos, $\lim_{n\rightarrow\infty}f(nx)=0$ then $\lim_{x\rightarrow\infty}f(x)=0$ 
I have no clue how to solve this one. Thank you.

REPLY [2 votes]: Lemma: If $U\subset(0,\infty)$ is an unbounded open set, then there exists an $x>0$ such that the sequence $(nx)_{n\geqslant0}$ falls into $U$ infinitely many times.
Using that lemma, you should be able to prove the contrapositive of what
you want: if $f(x)$ does not tend to $0$ when $x\to\infty$, then there exists an
$x>0$ such that $f(nx)$ does not tend to $0$ when $n\to\infty$.
Now it remains to prove the lemma. Consider the set
$$ X = \{x>0 : \{ nx \}_{n\geqslant0}\cap U~\text{is infinite} \}. $$
Assuming that $U$ is an unbounded open set, we want to prove that $X$ is not empty. Let's rewrite $X$ as follows:
\begin{align}
X &= \{x>0 : \forall N>0,~\exists n>N,~nx\in U \} \\
  &= \bigcap_{N>0}\bigcup_{n>N}\frac 1n U,
\end{align}
where $\frac 1n U$ is the set $\{u/n:u\in U\}$.
Now for any $N>0$, the open set $U_N=\bigcup_{n>N}\frac1nU$ is dense. To prove that, take some $y\in(0,\infty)$ and an $\varepsilon>0$, and let's find a $u\in U$ and an $n>N$ such that $|u/n-y|<\varepsilon$, or equivalently $|u-ny|<n\varepsilon$. The idea is to look at the intervals $I_n=(ny-n\varepsilon,ny+n\varepsilon)$, and to show that at some point one of them has to meet $U$. That's the case because if $n$ is large enough, two consecutive intervals $I_n$ and $I_{n+1}$ will start to overlap, so that $\bigcup I_n$ will cover a whole interval $[a,\infty)$.
More precisely, choose some $n_0>N$ such that $n_0>2y/\varepsilon$. Then $V=\bigcup_{n>n_0}(ny-2y,ny+2y)$ contains the interval $[n_0y,\infty)$, and since $U$ is unbounded, there is a point $u\in U\cap[n_0y,\infty)$. Now $u$ is in $V$, so there exists an $n>n_0$ such that $|ny-u|<2y$, which implies
$$ \left|\frac{u}{n}-y\right| < \frac{2y}{n} < \frac{2y}{n_0} < \varepsilon. $$
Finally, Baire's theorem allows us to conclude that $X$ is dense, so in particular it's not empty.