# Discontinuous functions from $\mathbb Q_p$ to $\mathbb R$

The question is how we construct a function $f:\mathbb Q_p\to\mathbb R$ so that $f$ is discontinuous at every $x_0\in\mathbb Q_p$.

-
Where does such a question come from? Is it idle speculation? – KCd Nov 17 '11 at 4:21
for each $x \in Q_p$ pick a number $f(x) \in \mathbb R$ in a "random" way... – N. S. Nov 17 '11 at 5:10
How do we pick $f(x)$ in a "random way"? – Jie Fan Nov 17 '11 at 5:12
@KCd: It's easy to contruct a discontinous function from $\mathbb Q_p$ to $\mathbb Q_p$, it's hard from $\mathbb R\to\mathbb R$. The left may be interesting? – Jie Fan Nov 17 '11 at 5:15
You should include such background in the question itself, so the point is clearer. Otherwise it seems like a, well, random question. – KCd Nov 17 '11 at 5:44

Let $D=\{0,1\}$ with the discrete topology, so that $D^\omega$ with the product topology is a Cantor set. $\mathbb{Q}_p$ is homeomorphic to $\omega\times D^\omega$ or, equivalently, to $D^\omega\setminus\{p\}$ for any $p\in D^\omega$. In particular, it has a countable dense subset $S$, and $\mathbb{Q}_p\setminus S$ is also dense in $\mathbb{Q}_p$. In fact it’s well-known that $\mathbb{Q}$ is dense in $\mathbb{Q}_p$, so we may take $S=\mathbb{Q}$, but any countable dense $S$ will work equally well.
Then $$\chi_S:\mathbb{Q}_p\to\mathbb{R}:x\mapsto\begin{cases}1,&x\in S\\ 0,&x\notin S\;, \end{cases}$$
the indicator (characteristic) function of $S$, is nowhere continuous, and in particular $\chi_\mathbb{Q}$ is nowhere continuous.