$\Longrightarrow)$ Considere $g : F \cup G \rightarrow \{0,1\}$ $\Longleftarrow)$ Considere $f^{-1}[[0,1/2)],f^{-1}[(1/2,1]]$