Determine where the complex function is continuous Determine where the function $f: \mathbb C \rightarrow \mathbb C$ is continuous:
$$f(z)=\begin{cases} 0 \text{ if } z=0 \text{ or } |z| \text{ is irrationals} \\
\frac{1}{q}\text{ if } |z|=\frac{p}{q} \in \mathbb Q \setminus \{0\} \text{ (written in lowest term) }\end{cases}$$
I was thinking that $f$ is continuous at $\{0\}$ since when $z$ approaches zero either from the irrational path or the rational path we get $f$ goes to zero which is $f(0)$. But I am not sure about the others. Since both $\mathbb Q$ and $\mathbb R\setminus \mathbb Q$ are dense in $\mathbb R$, it seems $f$ is not continuous except $\{0\}$.
Is there a more rigorous way to prove this? Thanks~
 A: Partial answer. Let $|\cdot|\colon \Bbb C \to \Bbb R$ denote the absolute value and $g\colon \Bbb R \to \Bbb R$ denote the Stars over Babylon function. It is known that $|\cdot|$ is continuous and $g$ is continuous at the irrationals (and discontinuous in the rationals). Since $f = g \circ |\cdot|$, $f$ is continuous at least in $\{z \in \Bbb C \mid |z| \in \Bbb R \setminus \Bbb Q\}$. This does not prove that $f$ is discontinuous everywhere else, though I think it is true in this case and it probably follows from mimicking the proof given in the linked page.
A: I will exclude $z=0$ since f is continuous at 0. Consider a point z where $|z|$ is irrational. Suppose $\{z_n\}$ is a sequence of rational points converging to z. Let $|z_n|=\frac {p_n} {q_n}$. If $\{q_n\}$ is bounded along a subsequence then it is constant along a subsequence , so $z_n$ can converge only if $p_n$ is also bounded. This forces $|z|$ itself to be rational, a contradiction. Hence $q_n \to \infty$ which implies that $f(z_n) \to f(z)$. On the other hand, if $|z|$ is rational then $f(z) \neq 0$ but f vanishes at points u close to z with $|u|$ irrational, so f is not continuous at z. 
