Your Professor was probably talking about Tonelli's Theorem in regard to $\sigma$-finiteness.
If $f \in L^{1}(\mu\times\nu)$, then Fubini's theorem holds, regardless of $\sigma$-finiteness of $\mu$, $\nu$ or not. Of course all of the measures must be complete, including the product measure. The way this is proved is by reducing to the case of positive $f$ because the positive $f_{+}$ and negative parts have finite integrals. That allows you to approximate $f_{+}$, for example, by a non-decreasing sequence of non-negative simple functions $\{\varphi_{n}\}$ converging upward to $f_{+}$ with the property that each is supported on a set of finite measure. This approximation is a critical part of the standard proof.
Tonelli's Theorem is a generalization of Fubini's Theorem for the case of positive functions $f$, where the assumption of integrability of $f$ is dropped; that is, you allow for the possibility that $\int f\,d(\mu\times\nu) = \infty$. You still get the same conclusion as Fubini's Theorem for such a case, provided you assume that the measures $\mu$ and $\nu$ are $\sigma$-finite. By adding this assumption of $\sigma$-finiteness, you are still able to get the existence of $\{\varphi_{n}\}$ as above which are once again supported on sets of finite measure. So the proof of Fubini's Theorem goes through, even without assuming $f$ has a finite integral. However, in this case, I think you can see the need for $\sigma$-finiteness, whereas in Fubini's Theorem, it was only necessary to assume $\int |f|\,d(\mu\times \nu) < \infty$ in order to get the desired approximation.
The assertion of Fubini's theorem for any integrable function what has been made in the book An Introduction to Measure and Integration by Inder K Rana is not correct. It should be the following $:$
Theorem (Fubini) $:$ Let $(X, \mathcal A, \mu)$ and $(Y,\mathcal B, \nu)$ be two complete $\sigma$-finite measure spaces. Let $(X \times Y,\mathcal A \otimes \mathcal B,\mu \times \nu)$ be the product measure space induced by $(X,\mathcal A, \mu)$ and $(Y,\mathcal B, \nu).$ Let $f \in L_1(\mu \times \nu).$ Then there exist $g \in L_1(\mu)$ and $h \in L_1(\nu)$ such that $$\int_{X \times Y} f\ d(\mu \times \nu) = \int_X g\ d\mu = \int_Y h\ d\nu.$$
Let us begin the proof from the last equality what I obtained i.e. \begin{align*} \int_{X \times Y} f(x,y)\ d(\mu \times \nu) (x,y) & = \int_X \left ( \int_{Y} f^+(x,y)\ d{\nu(y)} \right ) d{\mu}(x) - \int_X \left ( \int_{Y} f^-(x,y)\ d{\nu(y)} \right ) d{\mu}(x)\ \ \ \ {\label \equation (1)}\end{align*}
Let \begin{align*} E : & = \left \{x \in X\ \bigg |\ \int_Y f^+(x,y)\ d\nu(y) < +\infty \right \} \\ F : & = \left \{x \in X\ \bigg |\ \int_Y f^-(x,y)\ d\nu(y) < +\infty \right \} \end{align*} Since the maps $x \longmapsto \displaystyle {\int_Y} f^+(x,y)\ d\nu(y)$ and $x \longmapsto \displaystyle {\int_Y} f^-(x,y)\ d\nu(y)$ are both $\mu$-integrable it follows that $\mu (E^c) = \mu(F^c) = 0.$ Define a function $g^+ : X \longrightarrow \Bbb R$ defined by $$g^+(x) = \left ( \displaystyle {\int_Y} f^+(x,y)\ d\nu(y) \right ) \chi_E (x),\ x \in X$$ and a function $g^- : X \longrightarrow \Bbb R$ defined by $$g^-(x) = \left ( \displaystyle {\int_Y} f^-(x,y)\ d\nu(y) \right ) \chi_F (x),\ x \in X$$ Then clearly $g^+(x),g^-(x) < +\infty,\ $ for all $x \in X.$ Moreover \begin{align*} g^+(x) & = \displaystyle {\int_Y} f^+(x,y)\ d\nu(y) ,\ \text{for a.e.}\ x(\mu) \\ g^-(x) & = \displaystyle {\int_Y} f^-(x,y)\ d\nu(y) ,\ \text{for a.e.}\ x(\mu) \end{align*} Let $g : = g^+ - g^-.$ Since the maps $x \longmapsto \displaystyle {\int_Y} f^+(x,y)\ d\nu(y)$ and $x \longmapsto \displaystyle {\int_Y} f^-(x,y)\ d\nu(y)$ are both $\mu$-integrable and $(X,\mathcal A,\mu)$ is a complete measure space it follows that $g^+,g^-,g \in L_1(\mu)$ and we have the following equality \begin{align*} \int_X g^+\ d\mu & = \int_X \left (\int_Y f^+(x,y)\ d\nu(y) \right ) d\mu(x) \\ \int_X g^-\ d\mu & = \int_X \left (\int_Y f^-(x,y)\ d\nu(y) \right ) d\mu(x) \\ \int_X g\ d\mu & = \int_X g^+\ d\mu - \int_X g^-\ d\mu \end{align*} From the above three equalities it follows that $$\int_X \left (\int_Y f^+(x,y)\ d\nu(y) \right ) d\mu(x) - \int_X \left (\int_Y f^-(x,y)\ d\nu(y) \right ) d\mu(x) = \int_X g\ d\mu.$$
Now from $(1)$ it follows that $$\int_{X \times Y} f\ d(\mu \times \nu) = \int_X g\ d\mu.$$
Similarly by observing that \begin{align*} \int_{X \times Y} f(x,y)\ d(\mu \times \nu) (x,y) & = \int_Y \left ( \int_{X} f^+(x,y)\ d{\mu(x)} \right ) d{\nu}(y) - \int_Y \left ( \int_{X} f^-(x,y)\ d{\mu(x)} \right ) d{\nu}(y) \end{align*} and by exploiting the completeness of the measure space $(Y,\mathcal B,\nu)$ we can find out $h \in L_1(\nu)$ such that $$\int_{X \times Y} f\ d(\mu \times \nu) = \int_Y h\ d\nu.$$
This completes the proof.
QED
Best Answer
Check out Tonelli's Theorem. The point is that, for a non-negative function, if either iterated integral is finite, then the function is product integrable and you may envoke Fubini's Theorem to conclude that all integrals are equal. In particular, for a positive function, the iterated integrals, in either order, are always equal to the product integral, no matter if the function is integrable or not!
These statements suffice to cover also the case that either the positive part or the negative part of a function is product integrable, do you see how?
In a sense, it is Tonelli's Theorem which gives Fubini's Theorem its strength, since you commonly employ Tonelli's Theorem to show that the function is product integrable.