Let $(S, \Sigma)$ be a measurable space. Let $f: S \rightarrow \mathbb{R}$ be function and let $\mathcal{B}(\mathbb{R})$ be Borel $\sigma$-algebra on $\mathbb{R}$. Let $G(f)$ be the graph of $f$, that means $ G(f)=\{(x,f(x)) \in S\times \mathbb{R} : x \in S\} $. We write $ \Sigma \otimes \mathcal{B}(\mathbb{R})$ to indicate the product $\sigma$-algebra of $\Sigma$ and $\mathcal{B}(\mathbb{R})$.
We can prove that:
- If $f$ is $\Sigma$-$\mathcal{B}(\mathbb{R})$ measurable then $G(f) \in \Sigma \otimes \mathcal{B}(\mathbb{R})$.
- Assuming that $S$ is a Polish space and $\Sigma$ is its Borel $\sigma$-algebra, if $G(f) \in \Sigma \otimes \mathcal{B}(\mathbb{R})$ then $f$ is $\Sigma$-$\mathcal{B}(\mathbb{R})$ measurable.
The proof of item 1 is rather easy. The proof of item 2 is more advanced and uses analytic sets. One such proof can found in here (section 3 proposition 6).
Question: Can we prove that if $G(f) \in \Sigma \otimes \mathcal{B}(\mathbb{R})$ then $f$ is $\Sigma$-$\mathcal{B}(\mathbb{R})$ measurable in the general case (that is, just having $(S, \Sigma)$ a measurable space)? If not, is there a counterexample (that is, an example where $G(f) \in \Sigma \otimes \mathcal{B}(\mathbb{R})$, but $f$ is not $\Sigma$-$\mathcal{B}(\mathbb{R})$ measurable)?
(Of course changing the $\sigma$-algebra in the counter-domain makes it trivial to have counter-examples).
Remark: Examples where $G(f) \notin \Sigma \otimes \mathcal{B}(\mathbb{R})$ and $f$ is not $\Sigma$-$\mathcal{B}(\mathbb{R})$ measurable are rather trivial to produce. They are not what I am asking for.
Let $X=[0,1]$, $\Sigma$ be the Borel $\sigma$-algebra in $[0,1]$, let $A\subseteq [0,1]$ be a set not in $\Sigma$. Let $f$ be $\chi_A$ (the indicator function) of $A$. Its is easy to see that $G(f) \notin \Sigma \otimes \mathcal{B}(\mathbb{R})$, and $f$ is not $\Sigma$-$\mathcal{B}(\mathbb{R})$ measurable.