TITLE: The integral of $f(0.x_1 x_2 \cdots)= 0.\sigma(x_1)\sigma(x_2)\cdots$
QUESTION [5 upvotes]: Given $\sigma:\{0,1,2,\cdots,9\} \to\{0,1,2,\cdots,9\}$ being a bijection.
Given $f:[0,1]\to[0,1]$ satisfying
  $$f(0.x_1 x_2 \cdots)= 0.\sigma(x_1)\sigma(x_2)\cdots$$
  where $0.x_1 x_2 \cdots$ is the decimal expansion of the numbers in $[0,1]$.
Note that for terminating decimals $x=0.x_1 x_2 \cdots x_m$, $f(x)=0.\sigma(x_1)\sigma(x_2)\cdots\sigma(x_m)$. For example $f(0.1)=0.\sigma(1)$ not $0.\sigma(0)\sigma(9)\sigma(9)\sigma(9)\cdots $).
Prove that $f$ is integrable and evaluate $\int_0^1f$.

My attempt
I can show that $f$ is integrable.
Given an irrational number $\alpha=0.x_1x_2\cdots$, it's not hard to show $\forall M \in \mathbb{N}$ there exists $N>M$ such that all the numbers in $(\alpha-10^{-N},\alpha+10^{-N})$ have the same first $M$ digits after the decimal point. This yields that $f$ is continuous at all irrational numbers and hence $f$ is integrable.
But how to evaluate $\int_0^1 f$ ? I thought it must equal to $\int_0^1 x dx=\frac{1}{2}$, but I can't approach to it.
Any hints? Thanks in advance!

REPLY [3 votes]: Regard $x_n$ as function of $x$. Then

Each $x_n$ is integrable,
$\int_{0}^{1} \sigma(x_n) \, \mathrm{d}x = \frac{1}{10}\left(\sum_{d=0}^{9}d\right) = \int_{0}^{1} x_n \, \mathrm{d}x$, and
$f(x) = \sum_{n=1}^{\infty} \frac{1}{10^n}\sigma(x_n)$ converges uniformly by the Weierstrass M-test.

So it follows that
$$ \int_{0}^{1} f(x) \, \mathrm{d}x
= \sum_{n=1}^{\infty} \frac{1}{10^n} \int_{0}^{1} \sigma(x_n) \, \mathrm{d}x
= \sum_{n=1}^{\infty} \frac{1}{10^n} \int_{0}^{1} x_n \, \mathrm{d}x
= \int_{0}^{1} x \, \mathrm{d}x
= \frac{1}{2}. $$