If a function is discontinuous on $\mathbb Q$, is it necessarily discontinuous on $\mathbb R \setminus \mathbb Q$? Suppose $f : \mathbb{R} \rightarrow \mathbb{R}$ is discontinuous on $\mathbb Q$. Is $f$ necessarily discontinuous on $\mathbb R \setminus \mathbb Q$?
 A: Let $\{x\}$ represent the fractional part function. Consider the function $$f(x) = \sum\limits_{n=1}^{\infty} \frac{\{nx\}}{n^2} \quad (x \text{ real}).$$ Then $f$ is continuous at every irrational point even though it is discontinuous at every rational point. 
A: By Baire's theorem exotic examples are even the majority:
An explicit example is Thomae's function.
As another example take:
$$f(x\in\mathbb{Q}):=(x-\pi)^2\quad f(x\notin\mathbb{Q}):=-(x-\pi)^2$$
(That one is even differentiable only at Pi but discontinuous everywhere else.)
A: Here is simple example of a function continuous at all irrational numbers but discontinuous at every rational number.
For $x\in\Bbb Q$ write $x=\frac pq$ as reduced fraction and define $f(x)=\frac1q$; for  $x\notin\Bbb Q$ define $f(x)=0$.
Okay, so it seems like that is called Thomae's function (which I had not heard of before), and by a ridiculous number of other names for such a straightforward function. I'll use this as an excuse to add the function that I was thinking about before this simpler example came in the way, a function that does have some interesting behaviour at the irrational numbers.
In fact that other function is initially defined as a function on the positive irrational numbers only. Each such number$~x$ has a unique continued fraction expansion, giving a sequence $(a_n)_{n\in\Bbb N}$ of positive integers (except that $a_0$ is allowed to be zero too). One defines $f(x)=y$ where $y$ has continued fraction expansion $(a_{2n})_{n\in\Bbb N}$, obtained by dropping the numbers at odd index. This defines a continuous surjective function from $\Bbb R_{>0}\setminus\Bbb Q$ to itself; continuity is a consequence of the facts (1) that for every nonempty open interval there is a finite initial sequence such that all continued fractions extending it lie in the interval, and (2) that for every $N$ and every irrational number$~x$ there is a neighbourhood of $x$ in which all continued fractions expansions coincide with that of $x$ for the first $N$ terms.
This function$~f$ is in fact one coordinate of a continuous bijective function $\Bbb R_{>0}\setminus\Bbb Q\to(\Bbb R_{>0}\setminus\Bbb Q)^2$ with a similarly defined other coordinate (using the odd-index terms of the continued fraction). It is not hard to see that this function cannot be extended continuously at any rational number; therefore one will get a function of the desired type if one extends the definition in any manner that does not destroy the continuity at the irrational numbers. The simplest way to do that is to use essentially the same continued-fraction procedure to define $f$ at rational values; only the expansion now is finite (so $f$ will take a rational value) and has two possibilities of which one must choose one. How the details are settled does not matter.
