For any non-zero real number $a$, define $[a]$ to be the set of all numbers $a\frac{n}{m}$, where $n$ and $m$ are non-zero integers. Either $[a]=[b]$ or $[a]\cap[b]=\emptyset$; indeed, if $[a]$ and $[b]$ share a common element, then $a\frac{m}{n}=b\frac{p}{q}$ for non-zero integers $m,n,p,q$, which gives $a=b\frac{pn}{qm}$ and $b=a\frac{mq}{np}$.
Choose any irrational number $a_{1}\in(\frac{1}{2},1]$. Then choose an irrational number $a_{2}\in (\frac{1}{3},\frac{1}{2}]$ which is not in $[a_{1}]$. Next choose an irrational number $a_{3} \in (\frac{1}{4},\frac{1}{3}]$ which is not in $[a_{1}]\cup[a_{2}]$. Continue by induction to find a sequence of rational numbers $\{ a_{n}\}_{n=1}^{\infty}$ such that $a_{n} \in (\frac{1}{n+1},\frac{1}{n}]$ and so that none of the sets $[a_{n}]$ share a common element. Define a function $f$ so that $f(a_{n})=1$ and $f(x)=0$ otherwise. Then
$\lim_{n}f(a_{n})\ne 0$, even though $\lim_{n}a_{n}=0$. So $\lim_{x\rightarrow 0}f(x)\ne 0$. If $b$ is an irrational number, then $\{ b,\frac{b}{2},\frac{b}{3},\ldots\}$ contains at most one $a_{n}$ and, hence, $\lim_{n\rightarrow\infty}f(\frac{b}{n})=0$. If $b$ is rational then $f(b)=0$ and, hence, $\lim_{n\rightarrow\infty}f(\frac{b}{n})=0$ because $b/n$ is also rational.