TITLE: If $\,\lim_{n\to\infty}f(nx)\,$ exists, for all $x\in\mathbb R$, then so does $\,\lim_{x\to\infty}f(x)\,$
QUESTION [23 upvotes]: Let $\,f:\mathbb{R}\to\mathbb{R}$. The following limit exists for all $x \in \mathbb{R}$: 
$$\lim_{n\to ∞} f(nx) ,$$
where $n \in \mathbb N$. Is it correct that:
$$\lim_{x\to ∞} f(x) ,$$ 
exists if:
a) $f$ any function,
b) $f$ continuous on $\mathbb{R}$.

REPLY [6 votes]: We shall need the following fact:
Fact. Let $I_n=[a_n,b_n]\subset(0,\infty)$ be an increasing sequence of nontrivial closed intervals in the sense that
$$
a_n<b_n<a_{n+1}, \quad \text{for all $n\in\mathbb N$}.
$$
Then the set
$$
S=\Big\{x\in(0,\infty) : \text{$nx\in \bigcup_{k\in\mathbb N} I_k$ 
for infinitely many $n\in\mathbb N$}\Big\},
$$
is dense in $(0,\infty)$. In particular, if $\mathbb N=K\cup L$, with $|K|=|L|=\aleph_0$
and $K\cap L=\varnothing$, then
$$
S=\Big\{x\in(0,\infty) : 
\text{$mx\in \bigcup_{k\in K} I_k$ and  $nx\in\bigcup_{\ell\in L} I_\ell$ 
for infinitely many $m$ and infinitely many $\,n\in\mathbb N$}\Big\},
$$
is also dense in $(0,\infty)$.
We postpone the proof of this fact. Clearly, for every $\,x_0\in(0,\infty)$
$$
\liminf_{x\to\infty}\, f(x) \le
\lim_{n\to\infty}\,f(nx_0)\le
\limsup_{x\to\infty}\, f(x).
$$
Hence, if $\lim_{x\to\infty}\,f(x)$ does NOT exist, then we can pick 
$\,A,B \in\mathbb R$, such that
$$
\liminf_{x\to\infty}\, f(x) < A < B < \limsup_{x\to\infty}\, f(x).
$$
Due to the continuity of $f$ it is possible to define intervals $I_n=[a_n,b_n]$ and $J_n=[c_n,d_n]$, $n\in\mathbb N$, such that $\,a_n<b_n<c_n<d_n<a_{n+1}$, 
and 
$$
f\,\big|_{I_k} <A\quad\text{while}\quad f\,\big|_{J_k} >B,
\quad \text{for all $n\in\mathbb N$}.
$$
Due the Fact, there exists a dense set of points $x$, with the property 
that, for infinitely many $n$'s the multiple $nx$ belongs to $\bigcup_{k\in\mathbb N} I_k$, and for infinitely many $n$'s the multiple $nx$ belongs to $\bigcup_{k\in\mathbb N} J_k$.
This in turn implies that  $\lim_{n\to\infty}f(nx)$ does not exist.
Proof of the Fact. Let $[c,d]\subset(0,\infty)$. We shall prove that 
there exists an $x\in [c,d]$, such that for infinitely many $n$ the multiple 
$nx$ belongs to an interval of the form $I_k$, $\,k\in K$, and for 
infinitely many $n$ the multiple $nx$ belongs to an interval of the form 
$I_\ell$, $\ell\in L$. This is based on the observation that, if $a_n$ is 
sufficiently large, then 
$$
[c',d']=\frac{1}{N}[a_n,b_n]\cap[c,d]\quad\text{is a nontrivial interval},
$$
for $N=\lfloor a_n/d\rfloor+1$. This allows us to recursively define a sequence of nontrivial 
closed intervals $J_n=[c_n,d_n]$, where $[c_0,d_0]=[c,d]$, $[c_1,d_1]=[c',d']$, and we pick 
the $a_n$'s, so that the first one is in $K$, the next in $L$, the next in $K$ and so on. In
this way we have a sequence of closed intervals
$$
J_0\supset J_1\supset\cdots\supset J_n\supset J_{n+1}\supset\cdots.
$$
Clearly $S=\bigcap_{n\in\mathbb N} J_n\ne\varnothing$, and for each $x\in S$, infinitely
many multiples belong to $I_k$'s, $k\in K$, while infinitely
many multiples belong to $I_\ell$'s, $\ell\in L$.