At which points is the function discontinuous? Define the function $g(x)$ to take the value 0 at irrational values of $x$ and to take the value $1/q$ when $x=p/q$ is a rational number in lowest terms, $q>0$. At which points is $g$ continuous? At which points is the function discontinuous?
It seems like it would be discontinuous everywhere because between each irrational number there is a rational and between each rational there is an irrational which would imply alternating; however, we know that the irrationals are uncountable and the rationals are countable so it seems odd that the reals would alternate between rational and irrational numbers. So we are stuck on this...
 A: 
$g$ is discontinuous at every $x\in \Bbb Q$, but is continuous at evey
  $y\in \Bbb Q^{c}$

Proof:  
Let $x$ be rational and $x=p/q$, where $p$ and $q>0$ are relatively prime, then $g(x)=1/q>0$. Choose $\epsilon>0$ such that $1/q\ge \epsilon \gt 0$. Then for any $\delta >0$, we can find some irrational $x_0\in(x-\delta,x+\delta)$, with $|g(x_0)-g(x)|\ge \epsilon$.  
Let $y$ be irrational. Suppose that $g$ is discontinuous at some $x_0\in \Bbb Q^{c}$.
Then there is some $\epsilon_0 >0$ such that for each $n\in \Bbb N$, there is $x_n \in (x_0-1/n,x_0+1/n)$ and $|g(x_n)|\ge\epsilon_0$. So $x_n$ must be rational, let $x_n=p_n/q_n$. Note $x_n$ converge to $x_0$.
Since $|g(x_n)|=g(x_n)=1/q_n\ge \epsilon_0$, so $0<q_n\le 1/\epsilon_0$, for all $n$. Note $q_n\in \Bbb N$, so $Q=\{q_n:n\in \Bbb N\}$ must be finite. Hence $X=\{p_n/q_n:n\in \Bbb N\}=\{x_n:n\in \Bbb N\}$ is also finite. But then contradiction arises because there must be some $p_N/q_N$ appears infinitely many times in $x_n$, which means that $x_n$ either converge to $p_N/q_N$, or diverge, and by assumption $x_n \to x_0$.
$\therefore $ $g$ must be continuous at all irrational $y$.
