If $\,\lim_{n\to\infty}f(nx)\,$ exists, for all $x\in\mathbb R$, then so does $\,\lim_{x\to\infty}f(x)\,$ 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}$.
 A: Hint: If $f(x)=1$ on rationals and $0$ otherwise, then for any $x\in\Bbb R$, we have $\lim_{n\to\infty} f(nx)$ exists. What about $\lim_{x\to\infty} f(x)$?
What changes if $f(x)$ is continuous?
A: We shall need the following fact:
Fact. Let $I_n=[a_n,b_n]\subset(0,\infty)$ be a sequence of nontrivial closed intervals with $\,a_n\to\infty$,
and $K$ an infinite subset of $\mathbb N$, and let $S_K$ be the set
$$
S_K=\Big\{x\in(0,\infty) : \text{$nx\in \bigcup_{k\in K} I_k$ 
for infinitely many $n\in\mathbb N$}\Big\}.
$$
Then $S_K$ is dense in $(0,\infty)$.
Further, if $K, L\subset \mathbb N$, with $|K|=|L|=\aleph_0$, then $S_K\cap S_L$ 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).
$$
There exist sequences $\{x_n\}, \{y_n\},$ with $x_n\to\infty, y_n\to \infty$, $f(x_n)\to \liminf_{x\to\infty} f(x)$ and
$f(y_n)\to \limsup_{x\to\infty} f(x)$. These sequence can be chosen so that
$$
f(x_n)<A<B<f(y_n), \quad n\in\mathbb N.
$$
Due to the continuity of $f$ it is possible to define nontrivial closed intervals $I_n=[a_n,b_n]$, such that
$\,x_n\in(a_{2n-1},b_{2n-1}),\,y_n\in(a_{2n},b_{2n}),$ and
$$
f\,\big|_{I_{2n-1}} <A\quad\text{while}\quad f\,\big|_{I_{2n}} >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_{2k-1}$, and for infinitely many $n$'s the multiple $nx$ belongs to $\bigcup_{k\in\mathbb N} I_{2k}$.
This in turn implies that $\lim_{n\to\infty}f(nx)$ does not exist, for every such point.
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$.
Observation. If $\,a_m > \big(\frac{1}{c}-\frac{1}{d}\big)^{-1},$
and $\,N=\left\lfloor\frac{a_m}{d} \right\rfloor+1,\,$ then $[c',d'] = \frac{1}{N}[a_m,b_m]\cap [c,d]$
is a nontrivial interval.
To establish this observation, it suffices to show that
$\displaystyle\frac{a_m}{N}=\frac{a_m}{\lfloor\frac{a_m}{d}\rfloor+1}\in (c,d)$. Clearly,
$$
a_m > \frac{1}{\frac{1}{c}-\frac{1}{d}} 
\,\,\Longrightarrow\,\, \frac{1}{c}>\frac{1}{a_m}+\frac{1}{d}
\,\,\Longrightarrow\,\, \frac{1}{\frac{1}{a_m}+\frac{1}{d}}>c
$$
and hence
$$
c<\frac{1}{\frac{1}{d}+\frac{1}{a_m}}=
\frac{a_m}{\frac{a_m}{d}+1} \le 
\frac{a_m}{\lfloor\frac{a_m}{d}\rfloor+1} < \frac{a_m}{\frac{a_m}{d}}=d,
$$
and therefore, $\displaystyle
[c_1,d_1] = \frac{1}{N}[a_m,b_m]\cap [c,d]$
is a nontrivial interval.
This observation 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_m$'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
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$.
A: A counterexample has already been provided in response to (a). I'll answer (b) in the affirmative. The solution, which relies on the Baire Category Theorem, is an extension of my answer to this question from a while back, which is similar but makes the helpful assumption that the limits $\lim_{n\to\infty}f(nx)$ are all zero. There is, however, a completely different solution—given in Selected Problems in Real Analysis by Makarov et al.—that does not use the Baire Category Theorem, but instead relies on a lemma: If $G_1$ and $G_2$ are unbounded open sets in $\mathbb R^+$, then there is a number $x_0$ such that $nx_0\in G_i$ for infinitely many $n$. The proof employs Cantor's intersection theorem. Links to the book can be found in the other question I mentioned.
Anyways, here's my own proof. Fix $\epsilon > 0$ and define
$$
E_N = \left\{x: |f(nx)-f(mx)|\leq \epsilon\text{ for all }n,m\geq N\right\}.
$$
The sets $E_N$ are closed (write $E_N$ as the intersection over $n,m\geq N$ of the sets $\{x:|f(nx)-f(mx)|\leq\epsilon\}$, which are closed by the continuity of $x\mapsto |f(nx)-f(mx)|$). But also $[0,\infty)\subset\bigcup_NE_N$, so the Baire Category Theorem furnishes a nonempty open interval $(a,b)\subset \mathbb R^+$ and an integer $N$ such that $(a,b)\subset E_N$. This means that if $x\in(na,nb)$ for some $n\geq N$, then $|f(x)-f(mx)|\leq\epsilon$ for all $m\in \mathbb N$. 
Choose $M'\geq N$ so that
\begin{align*}
(M'a,\infty)=\bigcup_{n\geq M'}{(na,nb)};
\end{align*}
any $M$ bigger than $a/(b-a)$ will suffice. Thus, writing $M = M'a$,
\begin{align*}
\text{$|f(x)-f(mx)|\leq\epsilon\,$ for all $\,x>M$ and $m\in \mathbb N$.}\tag{1}
\end{align*}
Next define $g(x)=\lim_{n\to\infty}{f(nx)}$. We want to show that $g$ is constant. If $m$ is a positive integer, then $\{f(nmx)\}_{n=1}^{\infty}$ is a subsequence of $\{f(nx)\}_{n=1}^{\infty}$, and since the latter sequence converges to $g(x)$, the former does as well. Thus $g(x)=g(mx)$ for all integers $m\in \mathbb N$ and $x>0$. It follows by replacing $x$ with $x/m$ that $g(x/m) = g(x)$ and then that $g(x) = g(rx)$ whenever $r$ is rational. Therefore, as we'll see, it is sufficient to prove that $g(x) = g(y)$ when $x$ and $y$ are very large and very close to one another.
Making $m\to\infty$ in $(1)$ gives
\begin{align*}
\text{$|f(x)-g(x)|\leq\epsilon\,$ for all $\,x>M$.}\tag{2}
\end{align*}
Now pick $x,y>0$ arbitrarily. Then for all rational numbers $r$ and $s$ for which $rx$ and $sy$ are bigger than $Ma$, it follows from $(2)$ and the triangle inequality that
\begin{align*}
|g(x) - g(y)| & = |g(rx) - g(sy)| \\
& = |g(rx) - f(rx) + f(rx) - f(sy) + f(sy) - g(sy)| \\
&\leq 2\epsilon + |f(rx)-f(sy)|.
\end{align*}
Fixing $s$ and making $r\to sy/x$ through $\mathbb Q$, for instance, shows then that $|g(x) - g(y)|\leq 2\epsilon$; of course, $\epsilon$, $x$, and $y$ are arbitrary and so $g$ is constant, say $g\equiv A$.
Finally, $(2)$ shows that $f(x)\to A$ as $x\to\infty$, hence the limit exists.
A: If for all $x\in \mathbb{R}$ the limit, 
$$\lim_{n \to \infty} f(nx)$$ exists.  Then in particular, it exists for $x=1$.  It is NOT necessarily the case that 
$$\lim_{n \to \infty} f(n) = \lim_{x \to \infty} f(x)$$ 
exists, where we just change symbols in the limit.
Consider the comments comments below.
