# A semi-continuous function with a dense set of points of discontinuity

Let’s come back to Thomae’s function which is defined as:
$f: \left|\begin{array}{lrl} \mathbb{R} & \longrightarrow & \mathbb{R} \\ x & \longmapsto & 0 \text{ if } x \in \mathbb{R} \setminus \mathbb{Q} \\ \frac{p}{q} & \longmapsto & \frac{1}{q} \text{ if } \frac{p}{q} \text{ in lowest terms and } q > 0 \end{array}\right.$

We proved here that $$f$$ right-sided and left-sided limits vanish at all points. Therefore $$\limsup\limits_{x \to a} f(x) \le f(a)$$ at every point $$a$$ which proves that $$f$$ is upper semi-continuous on $$\mathbb R$$. However $$f$$ is continuous at all $$a \in \mathbb R \setminus \mathbb Q$$ and discontinuous at all $$a \in \mathbb Q$$.

# A prime ideal that is not a maximal ideal

Every maximal ideal is a prime ideal. The converse is true in a principal ideal domain – PID, i.e. every nonzero prime ideal is maximal in a PID, but this is not true in general. Let’s produce a counterexample.

$$R= \mathbb Z[x]$$ is a ring. $$R$$ is not a PID as can be shown considering the ideal $$I$$ generated by the set $$\{2,x\}$$. $$I$$ cannot be generated by a single element $$p$$. If it was, $$p$$ would divide $$2$$, i.e. $$p=1$$ or $$p=2$$. We can’t have $$p=1$$ as it means $$R = I$$ but $$3 \notin I$$. We can’t have either $$p=2$$ as it implies the contradiction $$x \notin I$$. The ideal $$J = (x)$$ is a prime ideal as $$R/J \cong \mathbb Z$$ is an integral domain. Since $$\mathbb Z$$ is not a field, $$J$$ is not a maximal ideal.

# Totally disconnected compact set with positive measure

Let’s build a totally disconnected compact set $$K \subset [0,1]$$ such that $$\mu(K) >0$$ where $$\mu$$ denotes the Lebesgue measure.

In order to do so, let $$r_1, r_2, \dots$$ be an enumeration of the rationals. To each rational $$r_i$$ associate the open interval $$U_i = (r_i – 2^{-i-2}, r_i + 2^{-i-2})$$. Then take $\displaystyle V = \bigcup_{i=1}^\infty U_i \text{ and } K = [0,1] \cap V^c.$ Clearly $$K$$ is bounded and closed, therefore compact. As Lebesgue measure is subadditive we have $\mu(V) \le \sum_{i=1}^\infty \mu(U_i) \le \sum_{i=1}^\infty 2^{-i-1} = 1/2.$ This implies $\mu(K) = \mu([0,1]) – \mu([0,1] \cap V) \ge 1/2.$ In a further article, we’ll build a totally disconnected compact set $$K^\prime$$ of $$[0,1]$$ with a predefined measure $$m \in [0,1)$$.