This is a strange function!

One example is the **Dirichlet function** \(1_{\mathbb{Q}}\).

\(1_{\mathbb{Q}}(x)=1\) if \(x \in \mathbb{Q}\) and

\(1_{\mathbb{Q}}(x)=0\) if \(x \in \mathbb{R} \setminus \mathbb{Q}\).

\(1_{\mathbb{Q}}\) is everywhere discontinuous because \(\mathbb{Q}\) is everywhere dense in \(\mathbb{R}\).

The function \(x \mapsto x \cdot 1_{\mathbb{Q}}(x)\) is continuous in \(0\) and discontinuous elsewhere.

## Mathematical exceptions to the rules or intuition