Understanding a function I am trying to understand the following function:
Let ${(r_1,r_2,r_3,...)}$ be an enumeration of the set of rational numbers. For each $r_n∈Q$, deﬁne
$u_n(x)= 
  \begin{cases}
    1/2^n       & \quad \text{if } x>r_n  \\
    0  & \quad \text{otherwise}
  \end{cases}$
Now, let $h(x)=\sum_{n=1}^∞ u_n(x)$. 
So I tried considering $x = 0$, then $h(0)=\sum_{n=1}^∞ u_n(0)$, I know that this is some sub-series of $\sum\frac{1}{2^n}$ but i'm having trouble getting beyond that. 
Thanks
 A: You want to show that $h$ is continuous on the irrationals. Let $x$ be irrational, let $y\in\mathbb{R}$, w.l.o.g assume that $x<y$ (since you only work with irrationals the case $y<x$ is similar) we have
$|h(x)-h(y)| = |\sum_{n=1}^\infty u_n(x)-u_n(y)|\leq \sum_{n=1}^\infty |u_n(x)-u_n(y)|$
now $|u_n(x)-u_n(y)|$ is either zero, or $1/2^n$ (because $u_n$ is monotone), 
In particular, if $x>r_n$ then $y>r_n$ and $|u_n(x)-u_n(y)|$ is zero.
Let $\varepsilon>0$ and pick $N$ so that $\sum_{n=N}^\infty 1/2^n<\varepsilon$ (why $N$ exists?).
Let $\delta<\min\{|x-r_1|,|x-r_2|,...,|x-r_N|\}$ 
Exercise: Prove that $|x-y|<\delta\rightarrow |u_n(x)-u_n(y)|=0$ for every $n\leq N$.
Hint 1:

 Hint 1: if $|x-y|<\delta$ then $|x-y|<|x-r_n|$, draw $x,r_n,y$ on the real line

Hint 2:

 Hint 2: if $|x-y|<\delta$ then $|x-y|<|x-r_n|$, if $x>r_n$ we already prove that $u_n(x)=u_n(y)$, otherwise assume that $x<r_n$, you also have that $x<y$ therefore $|x-y|<|x-r_n|\Rightarrow y-x<r_n-x\Rightarrow y<r_n$

Assuming the exercise $|x-y|<\delta$ implies that $$|h(x)-h(y)|=|\sum_{n=N}^\infty u_n(x)-u_n(y)|\leq \sum_{n=N}^\infty |u_n(x)-u_n(y)|\leq\sum_{n=N}^\infty 1/2^n<\varepsilon$$
