I have a questions about Borel sets. Here is how they defined in my book:

Now they say that, the set consits of open sets. But it must not nececarrily be all open sets on X?
The reason this created a problem for me is the following proof.

How can they know that this exact open set is contained in the Borel-sigma algebra?
Just so you have the info I will also give you my books definition of a measurable function:

The Borel $\sigma$-algebra $B$ is the smallest $\sigma$-algebra containing all open sets. So, by definition any open set is containing in $B$. Of course, not every set in $B$ is open. For instance, since $(-1/n, 1+1/n) \in B$ for all natural numbers $n$, so is the intersection of these sets, which is the closed interval $[0,1]$.