Preliminary: the members of I and of R are Euclidean open. Let p,q be real and let x∈(p,q), so that p<x and x<q. Put δ=min(x−p,q−x), a positive real number. Every real y with x−δ<y<x+δ satisfies y>x−(x−p)=p and y<x+(q−x)=q, hence lies in (p,q); by Euclidean Open Box Criterion in Rn, applied in R1, the interval (p,q) is Euclidean open, the criterion being satisfied vacuously when the interval is empty. Likewise, if a is real and a<x, then with δ=x−a every real y with x−δ<y<x+δ satisfies y>a, so every ray is Euclidean open. Since B(R) contains every Euclidean open subset of R, we get I⊆B(R) and R⊆B(R).
Claim 1. Let U be Euclidean open. If U is empty, take Ik=(0,0) for every k: this interval belongs to I because 0 is rational, and it is empty because no real x satisfies both 0<x and x<0, so the union of the Ik is U.
Suppose now that U is nonempty, and let D be the set of those θ∈Q2 for which the open interval (θ1,θ2) is contained in U.
First, every point of U lies in an interval indexed by D. Indeed, let x∈U. By Euclidean Open Box Criterion in Rn, applied in R1, there is a real δ>0 such that every real y with x−δ<y<x+δ lies in U. By claim 1 of The Rational Numbers are Dense in the Real Numbers there are rationals p and q with x−δ<p<x and x<q<x+δ. Every y with p<y<q then satisfies x−δ<y<x+δ and so lies in U; hence (p,q)⊆U, the pair (p,q) belongs to D, and x∈(p,q).
In particular D is nonempty. By claim 3 of The Integers and the Rational Numbers are Countable the set Q2 is countable, so its subset D is countable by claim 3 of Basic Properties of Countable Sets. Being countable and nonempty, D is the set of terms of a sequence (θk)k∈N in D. Put Ik=(θ1k,θ2k); each Ik belongs to I and is contained in U, so ⋃kIk⊆U. Conversely each x∈U lies in an interval (θ1,θ2) with θ∈D by the previous paragraph, and θ is a term θk of the sequence, so x∈Ik. Hence U=⋃k∈NIk.
Claim 2. By Generated Sigma-Algebra a generated σ-algebra is the smallest one containing the generating family. From I⊆B(R) we get σ(I)⊆B(R). Conversely, by claim 1 every Euclidean open subset of R is a union of a sequence of members of I and hence lies in σ(I), which is closed under countable unions; as B(R) is the smallest σ-algebra containing the Euclidean open sets, B(R)⊆σ(I). Therefore B(R)=σ(I).
Similarly R⊆B(R) gives σ(R)⊆B(R). For the reverse inclusion let (hk)k∈N be a sequence of positive real numbers with limit 0, which exists by Existence of a Sequence of Positive Real Numbers with Limit Zero, and fix a real number q. Then
k∈N⋂{x∈R:q−hk<x}={x∈R:q≤x}.
Indeed, if q≤x then q−hk<q≤x for every k, because hk>0; and if x<q then q−x>0, so, the sequence having limit 0 and positive terms, there is k with hk<q−x, that is x<q−hk, and x fails to lie in the k-th set. Each set in the intersection belongs to R, and a σ-algebra is closed under countable intersections by Sigma-Algebra and Measurable Space, so {x∈R:q≤x} lies in σ(R) and hence so does its complement {x∈R:x<q}. For any reals p,q we therefore have
(p,q)={x∈R:p<x}∩{x∈R:x<q}∈σ(R).
In particular I⊆σ(R), so B(R)=σ(I)⊆σ(R), and the two σ-algebras coincide.
Claim 3. Suppose f is measurable. Each ray is Borel by the preliminary step, and {x∈X:f(x)>a} is the preimage under f of the ray {t∈R:a<t}, so it lies in F. Conversely, suppose {x∈X:f(x)>a}∈F for every real a. Then the preimage under f of every member of R lies in F, and B(R) is generated by R by claim 2, so claim 2 of Generator Criterion for Measurability makes f measurable with respect to F and B(R).