How to prove here exists a function $f \in L^1(X,\mu)$ with $f>0$ $\mu$-a.e. iff $\mu$ is $\sigma$-finite. How to show that let $(X,\mathcal{M},\mu)$ be a measurable space, there exists a function $f \in L^1(X,\mu)$ with $f>0$ $\mu$-a.e. iff $\mu$ is $\sigma$-finite.
Can you please help me out? Thank you.

*

*If such a function exists, then put $A_n:=\{x\mid f(x)\geq \frac 1n\}$, $A_n$ is measurable and of finite measure since $f$ is integrable. Let $N:=\{x,f(x)\leq 0\}$. Then $X=N\cup\bigcup_{n\geq 1}A_n$. 

*Conversely, if $(X,\mathcal M,\mu)$ is $\sigma$-finite, let $\{A_n\}$ a sequence of pairwise disjoint sets such that $X=\bigcup_{n\geq 1}A_n$ and $\mu(A_n)$ is finite for each $n$. Then definite $f(x)=\sum_{n\geq 1}\frac 1{n^2(\mu(A_n)+1)}\chi_{A_n}$. Then check that $f$ is measurable, almost everywhere positive and integrable.

