I am solving the following exercise:
for $n \in \mathbb{N}$ and $a_1,a_2, \ldots ,a_n \in \{0,1\}$ we define: $$ I(a_n, \ldots , a_n) := \left \lbrack \sum_{i=1}^n \frac{a_i}{2^i}, \sum_{i=1}^n \frac{a_i}{2^i} + \frac{1}{2^n} \right \rbrack$$
(a) show that there is a transformation $g: \{0,1\}^\mathbb{N} \rightarrow \lbrack 0,1 \rbrack$ such that: $$ g\left ( \left(a_n\right)_{n\in \mathbb{N}}\right) \in \bigcap_{n \in \mathbb{N}} I(a_1, \ldots, a_n)$$
(b) show that $g$ is surjective (and therefore defines a binary representation of the real numbers within the unit interval).
(c) is $g$ injective (meaning is the binary representation unique)?
My Problem: This was an exercise asked by our analysis professor. (a) I do not understand what this transformation $g$ does. I understand that we should take an element $a_i$ and do the transformation $g$ and then we should get an result which lies in the interval $\lbrack 0,1 \rbrack$. If I assume any value for $n$ and then just randomly decide which $a_i$ are $0$ or $1$, I always get a result which lies in that interval. Nevertheless I do not see what I am supposed to do. Further I am not sure what do they mean with $\bigcap_{n \in \mathbb{N}} I(a_1, \ldots, a_n)$? I see that this should be the intersection of all those values I can calculate with the sum formula? Even if so that somehow does not help me to clarify the exercise.
I would be very thankful if someone could explain to me step-by-step what I am supposed to do in this exercise. I appreciate every little hint or help, because this exercise confuses me a lot.