# Graph of measurable function has measure 0 in the product measure space

I have the following homework problem:

Let $(X, M , \mu )$ be a $\sigma$-finite measure space. Show that the graph of any measurable function $f: X \rightarrow \mathbb{R}$ has measure 0 in the product measure space $(X×\mathbb{R},M⊗B_{\mathbb{R}}, \mu\times\lambda)$. Where $\lambda$ is the Lebesgue measure on $\mathbb{R}$.

My idea was to cover the graph by countably many generalized rectangles of arbitrarily small measure or, in other words, to prove that the graph has outer measure 0 but I'm not sure how to go with that idea since we'll probably need $\mu(X)< \infty$.

Any help will be appreciated.

Use Tonelli's theorem to show that for any measurable function $f \geq 0$: if we define the sets $$\Gamma = \{(x,t): 0 \leq t < f(x)\}\\ \Gamma' = \{(x,t): 0 \leq t \leq f(x)\}$$ Then $(\mu\times \lambda)(\Gamma) = (\mu\times \lambda)(\Gamma') = \int_{X}f(x)\,dx$
Extend this to include general measurable $f$. Conclude that your set, $\Gamma' - \Gamma$, has measure zero.