# $\mu$ is $\sigma$-finite $\iff \exists$ function $f \in \mathcal{L}^{1}(\mu)$ with $f(x)>0$ for all $x \in X$

Let $$(X,\mathcal{A}, \mu)$$ be a measure space. Prove:

$$\mu$$ is $$\sigma$$-finite $$\iff \exists$$ function $$f \in \mathcal{L}^{1}(\mu)$$ with $$f(x)>0$$ for all $$x \in X$$

My ideas

$$"\Leftarrow"$$

Let $$f \in \mathcal{L}^{1}(\mu)$$ with $$f(x)>0$$, $$\forall x \in X$$. So, $$f$$ is measurable. This implies that for a $$B_{n}$$ defined as $$B_{n}:=\{f>\frac{1}{n}\}$$ which is measurable, so $$\in \mathcal{A}$$. By definition, $$\{f>0\}=\bigcup_{n\in \mathbb N}B_{n}\in \mathcal{A}$$, but since $$f > 0, \forall x \in X$$ then $$X\subseteq\bigcup_{n\in \mathbb N}B_{n}$$ and $$\mu(B_{n})<\infty, \forall n \in \mathbb N$$, since $$\int_{X}fd\mu < \infty\Rightarrow \mu$$ is $$\sigma-$$finite.

$$"\Rightarrow"$$ I have no idea how to define this function, particularly as $$f>0$$, $$\forall x \in X$$

Let $$(E_n)_{n \in \mathbb{N}}$$ be measurable (disjoint) sets with $$\mu(E_n) < \infty$$ and $$\Omega = \bigcup_{n=1}^\infty E_n$$. Now define $$f(x) := \sum_{n=1}^\infty \frac{1}{2^n} \frac{1}{1 + \mu(E_n)} 1_{E_n}(x).$$ By definition, we have $$f(x) >0$$ for all $$x \in \Omega$$. On the other hand, we have $$\int f(x) d \mu(x) \le \sum_{n=1}^\infty 2^{-n} \frac{\mu(E_n)}{1+\mu(E_n)} \le 1.$$