Consider the following simple example of a function $f: \mathbb{R}\to\mathbb{R}$ which is open and discontinuous at all points. If $x\in\mathbb{R}$ is represented as *something*.$x\_1x\_2x\_3\dots$ in the binary system, then set $$f(x)=\lim\_{n\to\infty}\frac{x\_1+\cdots+x\_n}{n}$$ if the limit exists and belongs to $(0,1)$, and set $f(x)$ to (say) $\frac{1}{2}$ otherwise. 


Is this example known (I suppose it is), and what's the reference for it?



An example of an open discontinuous function
I saw it as an exercise (E1.4.2) in the book "Analysis Now" by "Gert. K. Pedersen" with slight difference; $f$ is defined by 
$$f:\mathbb R\rightarrow\mathbb R,\quad x\mapsto\limsup\frac1n{\sum\_{k=1}^nx\_n}$$
where $x-\lfloor x\rfloor=0.x\_1x\_2\dots$ is the binary expansion of the 
fractional part of $x$. 


