8. (FRG 3) For all rational $x$ satisfying $0 \leq x<1, f$ is defined by
$$
f(x)=\left\{\begin{array}{ll}
f(2 x) / 4, & \text { for } 0 \leq x<1 / 2, \\
3 / 4+f(2 x-1) / 4, & \text { for } 1 / 2 \leq x<1 .
\end{array}\right.
$$

Given that $x=0 . b_{1} b_{2} b_{3} \ldots$ is the binary representation of $x$, find $f(x)$.
8. By the definition of $f$, it holds that $f\left(0 . b_{1} b_{2} \ldots\right)=3 b_{1} / 4+f\left(0 . b_{2} b_{3} \ldots\right) / 4$ $=0 . b_{1} b_{1}+f\left(0 . b_{2} b_{3} \ldots\right) / 4$. Continuing this argument we obtain
$$
f\left(0 . b_{1} b_{2} b_{3} \ldots\right)=0 . b_{1} b_{1} \ldots b_{n} b_{n}+\frac{1}{2^{2 n}} f\left(0 . b_{n+1} b_{n+2} \ldots\right) .
$$

The binary representation of every rational number is eventually periodic. Let us first determine $f(x)$ for a rational $x$ with the periodic representation $x=0 . b_{1} b_{2} \ldots b_{n}$. Using (1) we obtain $f(x)=0 . b_{1} b_{1} \ldots b_{n} b_{n}+f(x) / 2^{2 n}$, and hence $f(x)=\frac{2^{n}}{2^{n}-1} 0 . b_{1} b_{1} \ldots b_{n} b_{n}=0 . \overline{b_{1} b_{1} \ldots b_{n} b_{n}}$.
Now let $x=0 . a_{1} a_{2} \ldots a_{k} \overline{b_{1} b_{2} \ldots b_{n}}$ be an arbitrary rational number. Then it follows from (1) that
$$
f(x)=0 . a_{1} a_{1} \ldots a_{k} a_{k}+\frac{1}{2^{2 m}} f\left(0 . \overline{b_{1} b_{2} \ldots b_{n}}\right)=0 . a_{1} a_{1} \ldots a_{k} a_{k} b_{1} b_{1} \ldots b_{n} b_{n}-
$$

Hence $f\left(0 . b_{1} b_{2} \ldots\right)=0 . b_{1} b_{1} b_{2} b_{2} \ldots$ for every rational number $0 . b_{1} b_{2} \ldots$.