Is this function between the sigma Algebra $G$ and the Borel Sigma measurable?
For any set $E$ the inverse image $g^{-1}(E)$ is the union of the set of all irrational numbers and a countable set or a subset of the set of rational numbers (depending on whether $0 \in E$ or not). Hence, $g$ is measurable.