I am having difficulty in the following function
$f(x) = \left\{\begin{matrix} x^{2} ; x \in \mathbb{Q} & \\ 0 ; x \not\in \mathbb{Q} & \end{matrix}\right.$
I have following fundamental doubts.
1) Does this function have limit at all rational number including zero?
2) Is this function continuous at every rational number?
Thanks
hint
Let $r \ne 0 $ be a rational .
considere two sequences
$$r_n=r+\frac 1n \;\; ( \in \Bbb Q)$$ and $$y_n=r+\frac{\pi}{n} \;\; ( \notin \Bbb Q)$$
both converge to $r$ but
$$f(r_n)=r^2+\frac 1n(\frac 1n+2r)$$ goes to $ r^2\ne 0$
and
$$f(y_n)=0$$ goes to $0$. we conclude that $$\lim_{x\to r}f(x) \text{ does not exist}.$$ $f$ is then not continuous at $r$.
For $r=0$, observe that
$$(\forall x\in \Bbb R) \;\; |f(x)|\le x^2$$ thus
$$\lim_{x\to 0}f(x)=0=f(0)$$ and $f$ is continuous at $0$.