A problem on continuity of a function on irrationals for $f(x) = \sum_{r_n \leq x} 1/n^2$ 
Let $\langle r_n\rangle$ be an enumeration of the set $\mathbb Q$ of rational numbers such that $r_n \neq r_m\,$ if $\,n\neq m.$ $$\text{Define}\; f: \mathbb R \to \mathbb R\;\text{by}\;\displaystyle f(x) = \sum_{r_n \leq x} 1/n^{2},\;x\in \mathbb R.$$
  Prove that $f$ is continuous at each point of $\mathbb Q^c$ and discontinuous at each point of $\mathbb Q$.

I find it difficult to prove especially the continuity on irrationals, I proved the discontinuity on a rational number in the following way is it correct?
Let $ c \in \Bbb Q $ then $ c=r_n $ for some $n \in \Bbb N  $ and
Let $ \epsilon_0 = 1/n^{2} $
Let $\delta > 0 $ be arbitrary and let $ x \in (c-\delta. c+\delta)$ such that $x<c $ 
Then $|f(x)-f(c)|>1/n^{2}=\epsilon_0 $
How do prove that it is continuous on irrationals? 
 A: Here's an outline to get you going. It is continuous on the irrationals because around any irrational you can find a neighborhood containing rationals of index greater than some chosen $N$ (by excluding the finitely many rationals that do not fit this criterion), and the sum $\sum_{n \geq N} \frac{1}{n^2}$ can be made arbitrarily small. Thus, at nearby points, the difference in the function is the difference in the rationals between my initial point and my nearby point, which is less than $\sum_{n \geq N} \frac{1}{n^2}$. 
However, this is not the case at rationals, because if $r_n$ is some rational, and $x$ slightly smaller than $r_n$, then the difference of $f$ between these points is at least $1/n^2$, regardless of how close $x$ is to $r_n$.
A: Your proof for $c\in\mathbb Q$ is almost fine. However, you only get $|f(x)-f(c)|\ge \frac1{n^2}$. But this can be cured by choosing $\epsilon_0$ just a little smaller.
For $c\notin \mathbb Q$ and $\epsilon>0$ show that there is $N$ such that $\sum_{n> N}\frac1{n^2}<\epsilon$. Sice $c$ is irrational, you can find a neighbourhood of $c$ that avoids the finally may rationals $r_1,\ldots, r_N$. Then each $x$ in this neighbourhood "agrees" with $c$ on whether or not to use the summands $\frac1{n^2}$ with $n\le N$ so that $|f(c)-f(x)|\le \sum_{n>N}\frac1{n^2}<\epsilon$.
Apparently, $\sum\frac1{n^2}$ can be replaced with any convergent series.
