Is $f$ continuous at $(0, 1)$ , $(1,1)$? $f(x,y) =
\left\{
 \begin{array}{ll}
  x^2y  & \mbox{if } x \in \mathbb{Q} \\
  y & \mbox{if } x \notin \mathbb{Q}
 \end{array}
\right.$
And the question is:
a) Is $f$ continuous at $(0, 1)$ ?
b) Is $f$ continuous at $(1, 1)$ ?
I know that the answer for (a) is no but I don't know how to prove this mathematically... My intuition is that when $x^2y = y$ ($x = 1,-1$ or $y = 0$) it is continuous but it's not the case...
For (b) I don't know how to prove this with the limit definition (from the same intuition i think the answer is yes and that the limit in this case is $1$)
Can you help me prove this in a more mathematically way?
 A: Actually your intuition that $f$ is continuous exactly at points where $x^2y=y$ is spot on. (Why do you say that is not the case?). We can prove this in general:

Lemma. Assume that $$ f(x) = \begin{cases} g(x) & \text{when }x\in A \\ h(x) & \text{when }x\notin A \end{cases}$$ where $A$ and its complement are both dense in the domain of $f$, and that $g$ and $h$ are continuous functions on the same domain. Then $f$ is continuous exactly at those $x_0$ where $g(x_0)=h(x_0)$.

(In your case, the common domain of $f$, $g$ and $h$ is $\mathbb R\times \mathbb R$, of course, so $x$ in the statement of the lemma is a pair of numbers).
Proof. First assume that $g(x_0)=h(x_0)$. We need to show that $\lim_{x\to x_0}f(x) = f(x_0) = g(x_0)$. Our opponent selects an $\varepsilon>0$, and we can then find $\delta_1>0$ and $\delta_2>0$ such that $|g(x)-g(x_0)|<\varepsilon$ whenever $|x-x_0|<\delta_1$ and $|h(x)-h(x_0)|<\varepsilon$ whenever $|x-x_0|<\delta_2$. But this means that when $|x-x_0|<\min(\delta_1,\delta_2)$, both $g(x)$ and $h(x)$ will be closer to $f(x_0)$ than $\varepsilon$, so we can tell our opponent $\delta=\min(\delta_1,\delta_2)$ and we're done.
Next, assume that $g(x_0)\ne h(x_0)$, and we will show that $f$ is not continuous at $x_0$. There are two cases:
If $x_0\in A$, then $f(x_0)=g(x_0)$. Let $\varepsilon=\frac12|h(x_0)-g(x_0)|$. There is then a $\delta_2>0$ such that $|h(x)<h(x_0)|<\varepsilon$ whenever $|x-x_0|<\delta_2$. Then no matter which $\delta>0$ we try to match $\varepsilon$ with, there will be some $x$ within a distance of $\min(\delta,\delta_2)$ from $x_0$ that is not in $A$ (because $A^\complement$ is supposed to be dense). However at this point we have $f(x)=h(x)$, and then by the triangle inequality,
$$ \begin{align} 2\varepsilon = |h(x_0)-g(x_0)| &\le |h(x_0)-f(x)|+|f(x)-g(x_0)| \\&= |h(x_0)-h(x)|+|f(x)-f(x_0)| < \varepsilon + |f(x)-f(x_0)| \end{align} $$
(since $|x-x_0|$ is less than both $\delta_2$). Subtracting $\varepsilon$ on both sides of this gives $|f(x)-f(x_0)|>\varepsilon$, and since this could be done for every $\delta$, $f$ is not continuous at $x_0$.
The case where $x\notin A$ is similar, just with $g$ and $h$ swapped.
A: Define two sequences as follow:
$a_i = (i^{-1},1)$ for $i \in N$.
$b_i =(\pi^{-i},1)$ for $i \in N$.
Now 
$\lim_{n\to\infty} f(a_n) \neq \lim_{n\to\infty} f(b_n) $. Hence the function is discontinuos at $(0,1)$.
A: To show (a), pick a sequence $a_n$ of irrationals converging to (0,1) and show that $\lim_{n \to \infty} f(a_n) \neq f(0,1)$.
For (b), take an $\epsilon$ around $f(1,1) = 1$, and use the continuity of both $x^2y$ and $y$ to find a single $\delta$ that satisfies the definition of continuity.
A: $$\begin{align*}&y_n=1\;,\;\;x_n=\frac\pi n\implies f(x_n,y_n):=1\xrightarrow[n\to\infty]{}1\\{}\\&y_n=1\;,\;\;x_n=\frac1n\implies f(x_n,y_n)=\frac1{n^2}\xrightarrow[n\to\infty]{}0\end{align*}$$
Observe that in both cases above $\;n\to\infty\;\implies\;(x,y)\to(0,1)\;$, and you prove (a) is not continuous.
Try now to tackle (b)
