$f(nx)\to 0$ as $n\to+\infty$

Let $I=\{1/k, k\in\mathbb N\}$.

Consider the function $f$ defined on every interval $[n,n+1]$ like so:

$$ f(x)=\begin{cases} 1-2n\left|n+\frac{1}{2n}-x\right| &\text{if }x\in[n,n+1/n] \\ 0 & \text{if }x\in[n+1/n,n+1] \end{cases} $$

$f$ is continuous on $\mathbb R^+$, and satisfies the hypothesis

For any $x\in I$, $f(nx)\to 0$ as $n\to+\infty$.

In fact, this function could have been chosen to be smooth, and the construction holds for any countable set. Indeed, if $I=\{x_k,k\in\mathbb N\}$, then we can construct a function $f$ which has a spike on $[1,2]\backslash(x_1\mathbb N)$, then another one on $[2,3]\backslash(x_1\mathbb N\cup x_2\mathbb N)$, and so on and so forth, since $[n,n+1]\backslash(\bigcup_{i=1}^nx_i\mathbb N)$ has non-empty interior.


At the first I remark that your proof works for all non-meager $I$ (that is which are not a countable union of nowhere dense sets). From the other hand, let $I$ be a meager subset of $\mathbb R^+$. Choose a sequence $\{F_n\}$ of closed nowhere dense sets such that $F_n\subset [1/n;n]$ for each $n$ and $\bigcup F_n\cup \{0\}\supset I$. The family $\mathcal F=\{mF_n:m\ge n^2\}$ is locally finite, so a set $F=\bigcup\mathcal F$ is closed. Since the set $F$ is meager, by Baire theorem, it does not contain a half-line. This means there exists a sequence $S=\{x_n\}\subset\mathbb R^+\setminus\{0\}$ which goes to infinity. Thus the set $S$ is closed. Since the closed sets $F\cup\{0\}$ and $S$ are disjoint and the space $\mathbb R^+$ is normal, there exists a continuous function $f: \mathbb R^+\to \mathbb R^+$ such that $f(F\cup\{0\})=0$ and $f(S)=1$. Therefore there exists arbitrary large $x$ such that $f(x)=1$, but for each $x\in I$ $f(nx)$ eventually gets $0$.