Let $(X, \mathcal{M}, \mu)$ be a semifinite [definition below] measure space and let $f: X \to [-\infty, \infty]$ be an extended $\mu$-integrable function such that $\int_X f \,d\mu = \infty$. Does the following condition hold?
For each $C > 0$ there exists a set $E \in \mathcal{M}$ with $\mu(E) < \infty$ such that $\int_E f \,d\mu > C$.
Clearly, it suffices to consider the case where $f$ is nonnegative since we must have $\int_X f^{+} \,d\mu = \infty$ and $\int_X f^{-} \,d\mu \in \mathbb{R}$, where $f^{+} := \max(f,0), f^{-} := - \min(f, 0)$, and $f = f^{+} - f^{-}$.
If $(X, \mathcal{M}, \mu)$ is $\sigma$-finite, then the claim is easy to prove: Assuming $f \geq 0$, take a measurable partition $\{E_k\}_{k=1}^{\infty}$ of $X$ such that $\mu(E_k) < \infty$ for all $k$, and set $X_n := \bigcup_{k=1}^{n} E_k$. Then $X_n \nearrow X$, $\mu(X_n) < \infty$, and $\lim\limits_{n \to \infty} \int_{X_n} f \,d\mu = \lim\limits_{n \to \infty} \int_X 1_{X_n} f \,d\mu = \infty$ by the Monotone Convergence Theorem. Consequently, for each $C > 0$ there exists some $n \in \mathbb{N}$ such that $\int_{X_n} f\,d\mu > C$. But what about the semifinite case? I'm not sure how to proceed without the $\sigma$-finite assumption.
This is my definition of semifinite:
Definition. A measure space $(X, \mathcal{M}, \mu)$ is called semifinite if, for every set $A \in \mathcal{M}$ with $\mu(A) = \infty$, there exists a set $E \in \mathcal{M}$ such that $E \subset A$ and $0 < \mu(E) < \infty$.
Update 1/22/25: I think I have it now, thanks to the following lemma.
Lemma (Exercise 1.14 of Folland, p.27) If $\mu$ is a semifinite measure on $(X,\mathcal{M})$ and $\mu(A) = \infty$, then for any $C > 0$ there exists $E \in \mathcal{M}$ with $E \subset A$ such that $C < \mu(E) < \infty$.
My proof. Assume $f$ is nonnegative and $\int_X f \,d\mu = \infty$. Then there there exists an increasing sequence of nonnegative simple functions $(\phi_n)_{n=1}^{\infty}$ such that \begin{align*} \int f \,d\mu = \lim_{n \to \infty} \int \phi_n \,d\mu. \end{align*}
Let $C > 0$. Then there exists some $N \in \mathbb{N}$ such that $\int_X \phi_N \,d\mu > C$. Since $\phi_N$ is simple, it has the form $\phi_N = \sum_{j=1}^{m} a_j 1_{A_j}$, where the $a_j$'s are positive real numbers and the $A_j$'s are measurable sets. If $\mu(A_j) < \infty$ for all $j$, then $E := \bigcup_{j=1}^{m} A_j$ has finite measure and \begin{align*} \int_E f \,d\mu \geq \int_E \phi_N \,d\mu = \int_X \phi_N \,d\mu > C \end{align*} and we're done. On the other hand, if $\mu(A_j) = \infty$ for some $j$, then by the lemma there exists some set $E \in \mathcal{M}$ such that $E \subset A_j$ and $\frac{C}{a_j} < \mu(E) < \infty$, which then implies \begin{align*} \int_E f \,d\mu \geq \int_E \phi_N \,d\mu \geq \int_E a_j 1_{A_j} \,d\mu = a_j \mu(E) > C. \end{align*}
Is this a sound proof?