Continuity of a function defined by decimal development I want to check the "intuitions" I have about this function $f:[0,1[\to[0,1[$ defined like this :
if $x=\sum_{n=1}^\infty \frac{a_n}{10^n}$ is the proper decimal expansion of $x\in[0,1[$,  ($(a_n)$ doesn't end with a infinite bunch of nines) then
$$f(x) = \sum_{n=1}^\infty \frac{a_{2n}}{10^n}$$
What I found :

*

*$f$ is continuous to the right at every $x\in[0,1[$,

*$f$ is continuous to the left at every $x\in[0,1[$ which is not decimal, (meaning the proper decimal expansion of $x$ doesn't end with an infinite number of zeroes)

*$f$ is continuous to the left at every $x\in[0,1[$ which is decimal with its last non nul decimal being at a even rank,

*$f$ is not continuous to the left at every $x\in[0,1[$ which is decimal with its last non nul decimal being at an odd rank.

I'll add some details about my computations later, but if anyone knows something about this function or could give me some pointers to this kind of functions defined by manipulating decimal developments, I would be glad.
Thanks for reading.
 A: OK, so this is what I found out :

*

*First, $f$ is continuous to the right at any $x\in[0,1[$. For this, I had to prove that if $y$ is sufficiently close to $x$ ($y>x$), then the first digits of $x$ and $y$ are the same, so $\left|f(x)-f(y)\right|$ can be as small as we want. For this, I provide the following proof :

*

*if $x=\sum_{n=1}^\infty \frac{a_n(x)}{10^n}$ and $y=\sum_{n=1}^\infty \frac{a_n(y)}{10^n}>x$, let $k$ be the smaller $n$ such that $a_n(y)\ne a_n(x)$. $y>x$, so $a_k(y)>a_k(x)$. Then
$$y-x > \frac{1}{10^k} + \sum_{n=k+1}^\infty \frac{a_n(y)-a_n(x)}{10^n}$$
Let $p_k$ be the first $n>k$ such that $a_n(x)\ne9$ (there is one because we have a proper expansion of $x$), we have
$$y-x \ge \frac{1}{10^k} - \sum_{n=k+1}^{p_k-1} \frac{9}{10^n} - \frac{8}{10^{p_k}} - \sum_{n=p_k+1}^\infty \frac{9}{10^n} = \frac{1}{10^{p_k}}$$
so if $k\le N$, then $y-x>10^{-p_k}>10^{-p_N}$. Then, if $y-x<10^{-p_N}$, $k$ must be greater than $N$.


*This means that if $y$ is sufficiently close to $x$ (more precisely $0<y-x<10^{-p_{2N}}$), then the first $2N$ decimals of $x$ and $y$ are the same, so the first $N$ decimals of $f(x)$ and $f(y)$ are the same. This proves that $f$ is continuous on the right of $x$.




*Now, we prove that $f$ is continuous to the left of a non decimal $x$. The computations are quite the same, using the fact that we can find non zero decimals of $x$ anywhere in its proper expansion.


*If $x$ is a decimal, we have to distinguish between two cases :

*

*if the last non null decimal of $x$ is at an even place $n_0=2m$, then for $p$ sufficiently large, we have
$$x-\frac{1}{10^p} = \sum_{n=1}^{2m-1} \frac{a_n(x)}{10^n} + \frac{a_{2m}(x)-1}{10^{2m}} + \sum_{n=2m+1}^p \frac{9}{10^n}$$
and any $y\in[x-10^{-p},x[$ must have the same first $p$ decimals. An easy calculus proves that
$$\left|f(x)-f(y)\right| \le \frac{1}{10^{\lfloor p/2\rfloor}}$$
and we can chose $p$ as large as we can.


*but if the last non null decimal of $x$ is at an odd place $n_0=2m+1$, we have
$$f(x)=_sum_{n=1}^m \frac{a_n(x)}{10^n}$$
and for $p>2m+1$,
$$f(x-10^{-p})=f(x)+10^{-m}-10^{-\lfloor p/2\rfloor}$$
and the limit of this when $p$ tends to $\infty$ is NOT $f(x)$.
I hope I didn't make any mistake. What I would like to know is if anyone could find a simpler demonstration of my results (that would be great), or find a mistake (that would be bad :-(
Thanks you if you had the courage to read all this.
