Limit of continuous function at infinity Consider a real, continuous function $f$ defined on $[0,\infty)$.

1.
If for any $x > 0$ $\lim\limits_{n\to\infty}f(n\cdot x) = 0$, does it mean that $\lim\limits_{x\to\infty}f(x) = 0$ ?

2.
If for any $x > 0$ $\lim\limits_{n\to\infty}f(n + x) = 0$, does it mean that $\lim\limits_{x\to\infty}f(x) = 0$ ?

($n$ represents natural number)
 A: For (1), surprisingly the answer is affirmative:

Theorem. Let $f$ be a continuous function defined on $(0, \infty)$, and assume that
$$ \lim_{\mathbb{N}\ni n\to\infty} f(nx) = 0 $$
for all $x > 0$. Then
$$ \lim_{\mathbb{R}\ni x\to\infty} f(x) = 0. $$

(In fact, the continuity assumption on $f$ can be relaxed so as to encompass piecewise continuous functions.) The proof hinges on an application of Baire's category theorem called Croft's lemma:

Croft's Lemma. Let $U_1, U_2, \ldots$ be subsets of $\mathbb{R}$ such that the interior $\mathring{U}_j$ is unbounded above for each $j \geq 1$. Then the set
$$ \mathcal{D} = \{ r \in \mathbb{R} : \text{for each $j \geq 1$, $n r \in U_j$ holds for infinitely many $n$} \} $$
is dense in $(0, \infty)$.

Its proof can be found in other posting in MSE. For instance, see this. Now let us see how this lemma helps prove the theorem:

Proof of Theorem. For the sake of proof by contradiction, assume that $f(x) \not\to 0$ as $x \to \infty$. Then there exists $\varepsilon > 0$ such that
$$U = \{ x \in (0, \infty) : |f(x)| > \varepsilon\}$$
is not bounded above. Then by setting $U_j = U$ for all $j$ in Croft's lemma, we find that the set
$$ \mathcal{D} = \{ x \in (0, \infty) : nx \in U \text{ infinitely often} \} $$
is dense in $(0, \infty)$. In particular, $\mathcal{D} \neq \varnothing$. However, for each $x \in \mathcal{D}$, the sequence $(f(nx))_{n\geq 1}$ cannot converge to $0$, contradicting the assumption on $f$. Therefore the desired claim follows.

A: With the test function (i.e. element of $C^\infty_c(\mathbb{R})$)
$$\phi_b(x)=\begin{cases}\exp(b^2/(x^2-b^2),\qquad&x\in]-b,b[\\
0,\qquad&x\notin]-b,b[
\end{cases}$$ for $b>0$ we define for $k\in\Bbb N$
$$\psi_k(x):=\phi_{1/k^2}(x-(k-1/k)),
$$
which is a function with a bump of height $e^{-1}$, width $2/k^2$ and center in $k-1/k$ and zero elsewhere. Now consider the function
$$f(x):=\sum_{k=1}^\infty\psi_k(x)
$$
Regarding the second question: Let $x_0>0$ fixed and WLOG $x_0\leq1$. As $x_0$ contributes a constant shift for $f(n+x_0)$, in the case $x_0\neq1$ once $1-1/k-1/k^2$ has passed $x_0$ the function will never be anything else than zero. In the case $x_0=1$, the bump will never be above $n+x_0$ for $n$ big enough. So $\lim\limits_{n\to\infty}f(n + x_0) = 0$ is satisfied (with the sequence limit) but obviously not $\lim\limits_{x\to\infty}f(x) = 0$.
A: I will give contra-example for hypothesis 2.
For any closed interval $I=[a,b]$ define "impulse" function $h(\cdot; I)$ to be any continuous function that is zero outside the interval $I$ and that has maximum $1$ on the interval $I$, e.g.
$$
  h(x;I) = \max\left\{
1 - \frac{2}{b-a}\left|x-\tfrac 1 2 (a+b)\right| ,0
\right\}.
$$
Contra-example to claim 2: Consider the sequence of intervals
$$
  I_n = [n+2^{-n},n + 2^{1-n}]
$$
and the function
$$
  f(x) = \sum_{n=1}^\infty h(x; I_n).
$$
This function is not convergent as $f(a_n)=1$ for the sequence of the midpoints
$$
  a_n = n + 3 \cdot 2^{-n+1}
$$
of the intervals $I_n$, but for any $x>0$ there is at most one $n$ such that $x+n \in I_k$ for some $k\in \mathbb N$.
Edit: As noted by @SangchulLee the following contra-example fails.
Contra-example to claim 1: The construction of this contra-example is analogous, we take into account the fact that $\log(n \cdot x) = \log(n) + \log(x)$. Consider the sequence of intervals
$$
  J_n = [\log(n)+2^{-n+1},\log(n) + 2^{-n}]
$$
and the function
$$
  g(x) = \sum_{n=1}^\infty h(x; J_n).
$$
Note that $$\log(n+1)-\log(n) = \log(1+1/n) > 2/n > 2^{-n},$$
so the intervals $J_n$ are disjoint. It can also be seen that for any $x>0$ there is at most one $n$ such that $\log(x)+\log(n) \in J_k$ for some $k\in \mathbb N$.
