3. (2003 Thailand Mathematical Olympiad) Define in the set of rational numbers: $f(0)=0, f(1)=1$,
$$
f(x)=\left\{\begin{array}{l}
\frac{f(2 x)}{4}, 0<x<\frac{1}{2} ; \\
\frac{3}{4}+\frac{f(2 x-1)}{4}, \frac{1}{2} \leqslant x<1 .
\end{array}\right.
$$

If $x$ is represented in binary, such as $x=\left(0 . b_{1} b_{2} b_{3} \cdots\right)_{2}$, find the binary representation of $f(x)$.
3. $f(x)=f\left(0 . b_{1} b_{2} b_{3} \cdots\right)=0 . b_{1} b_{1} b_{2} b_{2} b_{3} b_{3} \cdots$. Let $x=0 . b_{1} b_{2} b_{3} \cdots$, where $b_{i}=0$ or 1 (for each $i$).

If $b_{1}=0$, then the binary representation of the number
$$
x=0.0 b_{2} b_{3} b_{4} \cdots \text {. }
$$

So, the number $x$ in decimal representation is
$$
\begin{aligned}
x & =0+0 \times 2^{-1}+b_{2} \cdot 2^{-2}+b_{3} \cdot 2^{-3}+b_{4} \cdot 2^{-4}+\cdots \\
& =\frac{b_{2}}{4}+\frac{b_{3}}{8}+\frac{b_{4}}{16}+\cdots \\
& \leqslant \frac{1}{4}+\frac{1}{8}+\frac{1}{16}+\cdots<\frac{1}{2} .
\end{aligned}
$$

Since $x<\frac{1}{2}$, by (1) we get
$$
2 x=\frac{b_{2}}{2}+\frac{b_{3}}{2^{2}}+\frac{b_{4}}{2^{3}}+\cdots \text {. }
$$

The binary representation of $2 x$ is $0 . b_{2} b_{3} b_{4} \cdots$,
thus, $f(x)=\frac{f(2 x)}{4}=\frac{1}{4} f\left(0 . b_{2} b_{3} b_{4} \cdots\right)=0 . b_{1} b_{1}+\frac{1}{4} f\left(0 . b_{2} b_{3} b_{4} \cdots\right)$.
If $b_{1}=1$, then the binary representation of the number $x=0.1 b_{2} b_{3} b_{4} \cdots$, so, the decimal representation of the number
$$
x=\frac{1}{2}+\frac{b_{2}}{2^{2}}+\frac{b_{3}}{2^{3}}+\frac{b_{4}}{2^{4}}+\cdots \geqslant \frac{1}{2} .
$$

Therefore, $f\left(0.1 b_{2} b_{3} b_{4} \cdots\right)=f(x)=\frac{3}{4}+\frac{f(2 x-1)}{4}$.
On the other hand, $x=\frac{1}{2}+\frac{b_{2}}{2^{2}}+\frac{b_{3}}{2^{3}}+\frac{b_{4}}{2^{4}}+\cdots$, then
$$
2 x-1=\left(1+\frac{b_{2}}{2^{1}}+\frac{b_{3}}{2^{2}}+\frac{b_{4}}{2^{3}}+\cdots\right)-1=\frac{b_{2}}{2}+\frac{b_{3}}{2^{2}}+\frac{b_{4}}{2^{3}}+\cdots \text {. }
$$

The binary representation of $2 x-1$ is $0 . b_{2} b_{3} b_{4} \cdots$,
so, we have
$$
\begin{aligned}
f\left(0.1 b_{2} b_{3} b_{4} \cdots\right) & =\frac{3}{4}+\frac{1}{4} f\left(0 . b_{2} b_{3} b_{4} \cdots\right)=\left(\frac{1}{2}+\frac{1}{2^{2}}\right)+\frac{1}{4} f\left(0 . b_{2} b_{3} b_{4} \cdots\right) \\
& =0 . b_{1} b_{1}+\frac{1}{4} f\left(0 . b_{2} b_{3} b_{4} \cdots\right) .
\end{aligned}
$$

From (2) and (3) we get
$$
f(x)=f\left(0 . b_{1} b_{2} b_{3} \cdots\right)=0 . b_{1} b_{1}+\frac{1}{4} f\left(0 . b_{2} b_{3} b_{4} \cdots\right) .
$$

Similarly, we can get
$$
f(x)=0 . b_{1} b_{1}+0.00 b_{2} b_{2}+0.0000 b_{3} b_{3}+\cdots=0 . b_{1} b_{1} b_{2} b_{2} b_{3} b_{3} \cdots .
$$