Consider $f: \mathbb{R} \to \mathbb{R}$. Suppose that for all $x \in \mathbb{R}$ the following condition holds: $$f\Big(\frac{x}n\Big) \to 0, \quad n \to \infty.$$ Does it follow that $\lim_{x \to 0} f(x) = 0?$ If I'm right then there's a counterexample.
Question. Is there a simple counterexample? Is there an explicit form of such a function $f$?
My counterexample. It looks like we may create it this way. Find positive numbers $a_1, a_2, \ldots $ which are linearly independent over $\mathbb{Q}$ and which are s.t. $a_n \downarrow 0$. Put $f_1 (x) = \frac{1}k$ if $x = \frac{a_1}k$ for some $k \in \mathbb{N}$ and $f_1(x) = 0$ otherwise. Put $f(x) = \inf_n f_n(x)$. Notice that $f_m(a_n)=0$ if $m \ne n$ and $f_n(a_n)=1$. We have $f(a_n)=1$ and $a_n \to 0$ hence $f$ is a counterexample.
Addition. As @Martin R said below there's a simplification of this example: we may put $f(x) = 1$ if $x = a_n$ for some $n$, and $f(x)=0$ otherwise.
Yes. Without continuity, counter-example exists.
Claim 1: There exists a countable subset $A\subseteq[0,\infty)$ whose elements are $\mathbb{Q}$-linearly independent, in the sense that: For any pairwisely distinct $a_{1},a_{1},\ldots,a_{n}\in A$ and $r_{1},r_{2},\ldots,r_{n}\in\mathbb{Q}$, if $\sum_{k=1}^{n}r_{k}a_{k}=0$, then $r_{1}=\ldots=r_{n}=0$.
Proof of Claim 1: We construct $A$ by recursion. Pick any $a_{1}\in\mathbb{R}\setminus \{0\}$. Suppose that $a_{1},a_{2},\ldots,a_{n}$ have been chosen such that they are $\mathbb{Q}$-linearly independent. Note that $\{\sum_{k=1}^{n}r_{k}a_{k}\mid r_{k}\in\mathbb{Q}\}$ is a countable set while $\mathbb{R}$ is uncountable, so we may choose $a_{n+1}\in\mathbb{R}\setminus\{\sum_{k=1}^{n}r_{k}a_{k}\mid r_{k}\in\mathbb{Q}\}$. We go to verify that for any $r_{k}\in\mathbb{Q}$ if $\sum_{k=1}^{n+1}r_{k}a_{k}=0$, then $r_{1}=\ldots=r_{n+1}=0$. If $r_{n+1}\neq0$, then $a_{n+1}=-\frac{r_{1}}{r_{n+1}}a_{1}-\ldots-\frac{r_{n}}{r_{n+1}}a_{n}$, contradicting to how $a_{n+1}$ is chosen. Now $r_{n+1}=0$, and the expression reduces to $\sum_{k=1}^{n}r_{k}a_{k}=0\Rightarrow r_{1}=r_{2}=\ldots=0$ by induction hypothesis.
Define $A=\{a_{1},a_{2},\ldots\}$. It is clear that $A$ is $\mathbb{Q}$-linearly independent.
Enumerate $A=\{a_{1},a_{2},\ldots\}$. For each $i$, choose $r_{i}\in\mathbb{Q}$ suitably such that $r_{1}a_{1}>r_{2}a_{2}>r_{3}a_{3}>\ldots>0$ and $r_{n}a_{n}\rightarrow0$. Clearly, such a choice exists. For, choose $r_{1}\in\mathbb{Q}$ such that $r_{1}a_{1}\in(0,1)$. Suppose that $r_{1},r_{2},\ldots,r_{n}$ have been chosen. Choose $r_{n+1}\in\mathbb{Q}$ such that $r_{n+1}a_{n+1}\in(0,\frac{1}{n+1}\wedge r_{n}a_{n})$. (Here $x\wedge y:=\min(x,y)$. Denote $b_{n}=r_{n}a_{n}$. Let $B=\{b_{1},b_{2},\ldots\}$. Observe that $B$ is still $\mathbb{Q}$-linearly independent.
Define $f:\mathbb{R}\rightarrow\mathbb{R}$ by $f(x)=1_{B}(x)$. Clearly it is false that $\lim_{x\rightarrow0}f(x)=0$ because $f(b_{n})=1$ but $b_{n}\rightarrow0$. Next, we verify that $f(\frac{x}{n})\rightarrow0$ for each $x\in\mathbb{R}$. Observe that for each $x\in\mathbb{R}$, there exists at most one $n$ such that $\frac{x}{n}\in B$. For, if there exist $n_{1}<n_{2}$ such that $\frac{x}{n_{1}},\frac{x}{n_{2}}\in B$, then $n_{1}\left(\frac{x}{n_{1}}\right)+(-n_{2})\left(\frac{x}{n_{2}}\right)=0$, contradicting that $B$ is $\mathbb{Q}$-linearly independent. Now, it is obvious that $f(\frac{x}{n})\rightarrow0$.