Subject GRE question - set of points of discontinuity

I was just working on a Math Subject GRE practice test, and I got the following problem wrong:

Let $f$ be the function defined on the real line by

$\displaystyle f(x) = \begin{cases} \displaystyle \frac{x}{2} &\mbox{if } x \text{ is rational}, \\ \displaystyle \frac{x}{3} & \mbox{if } x \text{ is irrational}. \end{cases}$

If $D$ is the set of points of discontinuity of $f$, then $D$ is the

$(A)\, \text{Empty set} \\ (B)\, \text{set of rational numbers}\\ (C)\, \text{set of irrational numbers}\\ (D)\, \text{set of nonzero real numbers}\\ (E)\, \text{set of real numbers}\\$

I chose $(E)$, the set of real numbers, since this set is clearly discontinuous at both every rational number and every irrational number. However, the answer key told me the answer is $(D)$, the set of nonzero real numbers.

I find this very confusing because, as far as I know, $0$ is a rational number, since it can be written in the form $\displaystyle \frac{0}{q}$, for any integer $q$. Can $0$ also be irrational? I've been looking online to figure that out, and everywhere I've looked has told me that $0$ is only rational. Are they all wrong, or is there some other reason why $0$ is not a point of discontinuity?

I'm very confused :(

• $0$ is both rational and real. Continuity of $f(x)$ at $x=0$ can be seen by doing an $\epsilon-\delta$ proof. – user133631 Sep 25 '14 at 21:21
• The limit can also be obtained by squeeze theorem – user negative one over twelve Sep 25 '14 at 21:23

Your initial reasoning is mostly correct; however, you are missing a subtlety here: $f$ is continuous at $0$ because, loosely speaking, the behavior of $x/2$ and $x/3$ in a sufficiently small neighborhood of $0$ are such that they tend to the same limit. If the function had been $$f(x) = \begin{cases} x/2 & x \in \mathbb Q, \\ x/2 + 1 & x \not\in \mathbb Q, \end{cases}$$ then this function is not continuous anywhere on the real line.

• Thanks! That definitely makes sense. I might try user133631's suggestion also, and try an $\epsilon$-$\delta$ proof. – ALannister Sep 25 '14 at 21:25
• @JessyCat That's not really worth it for a GRE exam. Just know that since $\mathbb Q$ and $\mathbb R \setminus \mathbb Q$ are both dense in $\mathbb R$, the limit of $f(x)$ as $x$ approaches $0$ depends on the limits of both of the separate functions together. Since they agree, the limit exists. Where they disagree, the limit does not exist. – Dustan Levenstein Sep 25 '14 at 21:27
• +1 for the useful extra part "If the function had been ..." – Dave L. Renfro Sep 25 '14 at 21:54

Let $\epsilon > 0$ be given. To prove continuity at $a$, we must find $\delta(\epsilon) > 0$ such that $$|x-a| < \delta(\epsilon) \implies |f(x) - f(a)| < \epsilon$$ for $x \in V_{\delta}(a)$, where $V_{\delta}(a) = (x-a, x+a)$.

To prove continuity at $a = 0$, notice for nonzero $k$, $$|x-0| = |x| = \left|\dfrac{x}{k}\right|(k)=k\left|\dfrac{x}{k} - \dfrac{0}{2}\right|\text{.}$$ (I'm going by the assumption that $0$ is rational.)

Assume $x$ were rational. Then take $k = 2$ and $$2\left|\dfrac{x}{2}-\dfrac{0}{2}\right| = 2\left|f(x)-f(0)\right| < \delta(\epsilon) = \dfrac{\epsilon}{2}$$ so that $|f(x) - f(0)| < \epsilon$. If $x$ were irrational, take $k = 3$ and notice similarly that $$3\left|\dfrac{x}{3}-\dfrac{0}{2}\right| = 3\left|f(x)-f(0)\right| < \delta(\epsilon) = \dfrac{\epsilon}{3}$$ so that $|f(x) - f(0)| < \epsilon$ and hence, $f$ is continuous at $0$. (I didn't touch on this too much, but the most logical $\delta(\epsilon) = \min\left(\dfrac{\epsilon}{2}, \dfrac{\epsilon}{3}\right)$.)

Let $a \in \mathbb R$ s.t. rational sequence $b_n \to a$ and irrational sequence $c_n \to a$

$$f \ \text{is continuous at} \ x=a$$

$$\iff$$

$$\lim f(b_n) = \lim f(c_n)$$

$$\iff$$

$$\lim b_n/2 = \lim c_n/3$$

$$\iff$$

$$a/2=a/3$$

$$\iff$$

$$a=0$$