TITLE: Let $f$ be a continuous function satisfying $\lim \limits_{n \to \infty}f(x+n) = \infty$ for all $x$. Does $f$ satisfy $f(x) \to \infty$?
QUESTION [15 upvotes]: Let $f: \Bbb R \to \Bbb R$ be a continuous function satisfying $f(x+n) \to \infty$ as a sequence in $n$, for all $x$. Does $f$ satisfy $f(x) \to \infty$ as $x\to \infty$?

If we drop the continuity assumption then the claim is false, by considering a function tending more and more slowly to $\infty$ as we start at larger values in $(0,1)$. (Or many other examples)
As for context: a variant of this claim (when $f$ is analytic and we replace $n$ by a general increasing sequence $a_n$) could be useful to me at some technical exercise, and this is a simplification which I still cannot tackle.
Assuming by contradiction that $\exists M\forall x \exists x_0>x: f(x_0)\leqslant M$, we want to show that $\exists x \exists N>0 \forall n \exists n_0>n: f(x+n) \leqslant N$. No "quantifiers-level" logic seems to apply here.
Any ideas?

REPLY [13 votes]: An other counterexample could be $
f(x)=x^3\sin^2\left(\pi \left(x+\frac1x\right)\right)
$ for $x>0$. We see
\begin{align}
f(x+n)=&(x+n)^3\sin^2\left(\pi\left((x+n)+\frac1{x+n}\right)\right)\\
&=(x+n)^3\underbrace{\sin^2\left(\pi\left(x+\frac1{x+n}\right)\right)}_{g_x(n)}.
\end{align}
Next consider $\lim_{n\to\infty} g_x(n)=\sin^2(\pi x)$. If $x\notin\mathbb{N}$ it is clear we have $\lim_{n\to\infty}f(x+n)=\infty$. Otherwise we compute the power series of $\sin^2$ around a root $\zeta$ which is
\begin{align}
\sin^2(x)&=\left(\sin(x)\right)^2=\left(\sin(\zeta)+\sin'(\zeta)(x-\zeta)+\sin''(\zeta)(x-\zeta)^2+o((x-\zeta)^3)\right)^2\\
&=\left(\pm(x-\zeta)+o((x-\zeta)^3)\right)^2\\
&=(x-\zeta)^2+o((x-\zeta)^4).
\end{align}
For $x\in\mathbb{N}$ we compute \begin{equation}
\pi\left(x+\frac1{x+n}\right)-\pi x=\frac{\pi}{x+n}
\end{equation}
and conclude
\begin{align}
(x+n)^3\sin^2\left(\pi\left(x+\frac1{x+n}\right)\right)&=(x+n)^3\left(\frac{\pi^2}{(x+n)^2}+o\left(\frac1{(x+n)^4}\right)\right)\\
&=\pi^2(x+n)+o\left(\frac1{(x+n)}\right).
\end{align}
We see that even if $x\in\mathbb{N}$ we get $\lim_{x\to \infty}f(x+n)=\infty$.
Finally, we see that $\lim_{x\to\infty} f(x)$ doesn't exist. Since $n+\frac1n<n+1<n+1+\frac1{n+1}$ for $n>1$ the IVT yields $x_n\in(n,n+1)$ such that $x_n+\frac1{x_n}=n+1$. This yields $f(x_n)=0$ although $n<x_n\to\infty$ for $n\to\infty$.