# Limit of a continuous real valued function

I want to show the following property.

For a continuous function $f:\mathbb{R}\rightarrow\mathbb{R}$
If ($\forall x \in \mathbb{R},$ $x\not= {0} \implies \lim _{n\rightarrow\infty,\ n\in \mathbb{N}} f(nx)=\infty$), then $\lim _{x\rightarrow\infty} f(x)=\infty$

I'm trying to prove the above by using the Dirichlet's approximation, but have made no progress.

Any help will be appreciated. Thank you.

Suppose that $f(x)$ does not tend to $\infty$; our task is then to find an $x$ such that $f(nx)$ doesn't tend to $\infty$.

Because $f(x)\nrightarrow \infty$, there is an $M$ such that $A=\{x\mid f(x)<M\}$ is upwards unbounded. By the following lemma we can find an $x$ such that infinitely many $nx$ lie in $A$. This means that $f(nx)\nrightarrow \infty$ and we're done.

Lemma. Let $A$ be an upwards unbounded open subset of $(0,\infty)$. There exists $x\in \mathbb R$ such that $\{n\in\mathbb N\mid nx\in A\}$ is infinite.

Proof: We construct a sequence of nested nontrivial cloasd intervals $B_1\supseteq B_2\supseteq B_3\supseteq \cdots$ such that for each $k$, $\{n\in\mathbb N\mid nB_k \subseteq A \}$ has at least $k$ elements. Once we have this, we can just choose $x\in\bigcap_k B_k$.

First $B_1$ will be any closed subinterval of $A$.

To choose $B_{k+1}$ for $k\ge 1$, let $B_k=[a,b]$. Without loss of generality we can assume that $\{n\in\mathbb N\mid nB_k\subseteq A\}$ has exactly $k$ elements (otherwise just set $B_{k+1}=B_k$); let $N$ be its maximum element.

Whenever $n>\frac{a}{b-a}$ we have $nb>(n+1)a$ or in other words $nB_k$ and $(n+1)B_k$ overlap. Therefore $$\bigcup_{n>N, n>a/(b-a)} nB_k = [c,\infty)$$ for some $c\in\mathbb R$, and since $A$ is upwards unbounded it contains some number $\ge c$. In other words, there is an $y\in B_k$ and $n>N$ such that $ny\in A$. Because $A$ is open there is a $\varepsilon$ such that $[ny-n\varepsilon,ny+n\varepsilon]\subseteq A$. Now $B_{k+1}=B_k\cap[y-\varepsilon,y+\varepsilon]$ will have the desired property. $\Box$