How take example such this three conditions.is continuous at all irrationals, discontinuous at all rationals Example:
The function $f(x)$ such this follow three conditions:
(1): $x\in [0,1]$
(2):
such $f(x)$ is continuous at all irrationals, discontinuous at all rationals;
(3):and $f$   have many  infinite number discontinuity point of the second kind in $[0,1]$
my try: if only such condition $(1)$ and $(2)$,I can take this example:
Riemann function:

$f(x)=\begin{cases}
\dfrac{1}{p}, & x=\dfrac{q}{p}, ~p,q\in \mathbb{N}, ~(p,q)=1\\
0, & x=0,~1~,~\text{or}~x\in \mathbb{R} \setminus \mathbb{Q}
\end{cases}$

But we have must such condition $(3)$,so we easy see this Riemann function is not such it.so Now what's function such it?
Thank you  very much!
 A: Here's an idea with some details left to check perhaps.  For $x \in \mathbb{Q}$ let $\ell(x)$ be the length of the continued fraction expansion $[x_1; x_2, \dotsc x_n]$ of $x$ (where integral $x$ have expansion $[x]$ of length $1$).  For $n \geq 1$ let $$F_n = \{ x \in \mathbb{Q} \mid \ell(x) = n \}.$$  Then 


*

*The sets $F_n$ are mutually disjoint

*$\cup_{n \geq 1} F_n = \mathbb{Q}$

*$\overline{F_n} = \cup_{k \leq n} F_k \subset \mathbb{Q}$.


Now define:
$$f(x) = \begin{cases}
\frac{1}{\ell(x)} & \textrm{if } x \in \mathbb{Q}\\[1ex]
0 & \textrm{otherwise}
\end{cases}$$
Then $f$ is continuous on $\mathbb{R} \setminus \mathbb{Q}$ and has a discontinuity of the second kind at every rational $x$.
A: This is a variant of WimC’s idea that avoids continued fractions.
Let $K=\{0\}\cup\{2^{-n}:n\in\Bbb N\}$. Let $z$ be the infinite sequence of zeroes, and let 
$$X=\left\{\langle x_k:k\in\Bbb N\rangle\in{}^{\Bbb N}K:\exists m\in\Bbb N\,\forall k\ge m(x_k=0)\right\}\setminus\{z\}\;.$$
Let $\preceq$ be the lexicographic order on $X$, and endow $X$ with the corresponding order topology. For $x=\langle x_k:k\in\Bbb N\rangle\in X$ let 
$$\ell(x)=\min\{m\in\Bbb N:\forall k>m(x_k=0)\}\;.$$
For $n\in\Bbb N$ let $L_n=\{x\in X:\ell(x)=n\}$, and let $F_n=\bigcup_{k\le n}L_k$; $F_n$ is closed in $X$. 
It’s not hard to show that $X$ embeds order-isomorphically and homeomorphically in $\Bbb Q$: start by sending $L_0$ to $K\setminus\{0\}$ in the obvious way, and recursively extend the embedding from $F_n$ to $F_{n+1}$ for $n\in\Bbb N$. Let $h$ be the resulting embedding, let $Y=h[X]$, and let $g=h^{-1}$.
Suppose that $x=\langle x_k:k\in\Bbb N\rangle\in L_n$; then $x_n\ne 0$, but $x_k=0$ for all $k>n$. For $k,m\in\Bbb N$ let 
$$y_k^{(m)}=\begin{cases}
x_k,&\text{if }k\le n\\
2^{-m},&\text{if }k=n+1\\
0,&\text{if }k>n+1\;.
\end{cases}$$
For $m\in\Bbb N$ let $y^{(m)}=\left\langle y_k^{(m)}:k\in\Bbb N\right\rangle\in L_{n+1}$; then the sequence $\left\langle y^{(m)}:m\in\Bbb N\right\rangle$ converges (monotonically downward) to $x$ in $X$.
Now define
$$f:\Bbb R\to\Bbb R:x\mapsto\begin{cases}
2^{-\ell(g(x))},&\text{if }x\in Y\\
0,&\text{otherwise}\;.
\end{cases}$$
Fix $y\in Y$. Then $g(y)\in L_n$ for some $n\in\Bbb N$, and we just saw that there is a sequence $\langle z_m:m\in\Bbb N\rangle$ in $L_{n+1}$ that converges to $g(y)$. Thus, $\langle h(z_m):m\in\Bbb N\rangle$ converges to $x$ in $\Bbb R$, and $f(z_m)=2^{-(n+1)}$ for each $m\in\Bbb N$. On the other hand, $y$ is a limit of irrationals, and $f$ is zero on the irrationals, so $f$ has an essential discontinuity at $y$.
Finally, $f$ is continuous at each point of $\Bbb R\setminus Y$. To see this, let $y\in\Bbb R\setminus Y$. Let $\epsilon>0$ be arbitrary, and choose $n\in\Bbb N$ large enough so that $2^{-n}\le\epsilon$. Let $U=\Bbb R\setminus h[F_n]$; $U$ is an open nbhd of $y$, and $f(z)<2^{-n}\le\epsilon$ for each $z\in U$.
To make this discontinuous at all rationals, modify the definition of $f$ at points of $\Bbb Q\setminus Y$ to agree with the Riemann function as given in the question. Alternatively, modify the construction of $X$ by replacing $K$ by $K\cup\{-2^{-n}:n\in\Bbb N\}$, in which case $\langle X,\preceq\rangle$ can be mapped order-isomorphically and homeomorphically onto $\Bbb Q$.
