What can be said about the Lebesgue integral of the function in the interval $[0,1]$ defined as $$f(x)= \begin{cases}9^n, x\in\mathbb{Q}^c\\0, \:x\in\mathbb{Q}\end{cases}$$ where $n$ is the number of zeroes immediately after decimal point.
I think the answer is 1, but am unable to justify it. Is it correct, or is there another answer. Thanks beforehand.
Let us think probabilistically. The decimal digits of a random number from $[0,1]$ are iid random variables, uniformly distributed on $\{0,1,\dots,9\}$. The index $N$ of first non-zero digit has then the geometric distribution with success probability $9/10$. Therefore, $$ \int_0^1 f(x) dx = \mathsf{E} [9^{N-1}] = \sum_{n=1}^\infty 9^{n-1}\cdot\mathsf{P}(N=n) = \sum_{n=1}^\infty 9^{n-1}\cdot\frac{9}{10^n}=9. $$