How to calculate this limit of a function defined in pieces? Calculate $$\lim_{x\rightarrow~ 0} f(x)$$ where 
$$f(x)=\left\{\begin{matrix} x~\textrm{if}~x\in \mathbb{Q}\\x^2 ~\textrm{if}~x\notin \mathbb{Q} \end{matrix}\right.$$
To me it seems like the function will have limit $0$ but I'm not sure how to show/prove it.

Hint: $0\le|f(x)|\le|x|$ for every $x\in[-1,1].$ From squeeze theorem you get:
$$\lim\limits_{x\rightarrow 0} |f(x)|=0,$$
which is equivalent to:
$$\lim\limits_{x\rightarrow 0} f(x)=0.$$
