Proving that the set of real numbers with digit 5 appearing infinitely often is Borel by using a Borel measurable function I am trying to prove the following statement:
Show that the set of real numbers that have a decimal expansion with the digit 5 appearing infinitely often is a Borel set.
$\textbf{using a Borel measurable function}$ (similar questions have been asked before but none (as far as I have been able to see) have tried to prove it in this way.
The only thing that I have been able to come up with after several tries is to use the indicator function $\chi_{E}:\mathbb{R}\to\mathbb{R}$,
$\chi_{E}(x):=\begin{cases} 1 & \text{if }x\in E\\ 0 &\text{if }x\notin E\end{cases}$
where $E:=\{x\in \mathbb{R}: x \text{ has a decimal expansion with the digit 5 appearing infinitely often} \}$.
Then if $B$ is a Borel set we have that $\chi_E^{-1}(B)=\begin{cases}E &\text{ if }0\notin B\text{ and }1\in B\\ \mathbb{R}\setminus E & \text{ if }0\in B\text{ and }1\notin B\\ \mathbb{R} & \text{ if }0\in B\text{ and }1\in B\\ \emptyset & \text{ if }0\notin B\text{ and }1\notin B\end{cases}$ so in particular if we set $\mathcal{S}:=\{\emptyset,E,\mathbb{R}\setminus E,\mathbb{R}\}$ this should be an $\mathcal{S}$-measurable function and $\textbf{I was wondering if it is also a Borel measurable function}$ so I can say that $\chi_{E}^{-1}(\{1\})=E$ is Borel.
So, I would be very grateful if someone either gave me an hint about how to do this or disproved my approach explaining to me why this isn't a feasible approach.
 A: This is rather long to be a comment, so I post it as an answer.
Let $E:=\{x\in \mathbb{R}: x \text{ has a decimal expansion with the digit 5 appearing infinitely often} \}$
For any $n \in \Bbb N$, $n>0$, let $E_n:=\{x\in \mathbb{R}: x \text{ has a decimal expansion with the digit 5 appearing in the $n$th position} \}$.
It is easy see that, for any $n \in \Bbb N$, $n>0$, $E_n$ is a Borel measurable set, so $\chi_{E_n}$ is a Borel measurable function.
Now, note that $\chi_E= \limsup_{n \to \infty} \chi_{E_n}$. So $\chi_E$ is a Borel measurable function. So $E$ is a Borel measurable set.
Remark: The above argument can be done directly with the sets, but the OP requested to use Borel measurable functions. Directly with the sets, we would have:
$$ E = \limsup_n E_n = \bigcap_{k=1}^{\infty} \bigcup_{n=k}^{\infty} E_n$$
Since, for any $n \in \Bbb N$, $n>0$, $E_n$ is a Borel measurable set, it follows that $E$ is a Borel measurable set.
A: Unfortunately the issue of measurability requires a careful (but simple) look at the decimal expansion of numbers.
By using the fractional part function $\phi:x\mapsto x-\lfloor x\rfloor$ ,which is measurable, it is enough to consider numbers between $0$ and $1$. Every number $x$ has a unique decimal expansion $x=\sum^\infty_{n=1}10^{-n}a_n(x)$, where $a_n(x)\in\{0,1,\ldots,9\}$ and where the number of $a_n$'s different from $0$ is infinite (for example $.5=.4999\ldots$)
The functions $x\mapsto a_n(x)$ are measurable. For example
\begin{align}
A^5_1=\{x\in(0,1):a_1(x)=5\}&=(.5,,.6]\\
A^5_2=\{x\in(0,1):a_2(x)=5\}&=\bigcup^9_{a=0}(.a5,.a6]\\
A^5_3=\{x\in(0,1):a_3(x)=5\}&=\bigcup^{9,9}_{a,b=0}(.ab5,.ab6]\\
etc.
\end{align}
Now the measurability of some important sets is established, you can proceed as you planned. For instance, one may consider $$F(x)=\sum^\infty_{n=1}\mathbb{1}_{A^5_n}(x)$$
which is a measurable function with values in $\mathbb{Z}_+\cup\{\infty\}$. You are interest in
$$\begin{align}
E=\{x:F(x)=\infty\}&=\{x:a_n(x)=5\,\text{infinitely often}\}\\
&=\{x:\limsup_n\mathbb{1}_{A^5_n}(x)>0\}=\bigcap^\infty_{n=1}\bigcup^\infty_{m=n}A^5_m
\end{align}$$
From this, you can see that $E$ is indeed measurable. Notice that the a similar procedure works for any other digit.
Hope this helps to clarify a few things.
