If possible, I need a review of the following proof:
Let $(X, \mathcal{M}, \mu)$ be a measure space with $\mu$ being $\sigma$-finite. Let $w_1,w_2 : X \mapsto [0,+\infty]$ be two measurable functions such that $\int_{E} w_1 \, d \mu = \int_{E} w_2 \, d \mu$ for every $E \in \mathcal{M}$. Then it follows $w_1=w_2$ a.e in $X$.
Now, I can prove the statement if $w_1,w_2$ were only real valued and not extended real valued since it's equivalent to prove that $\int_{E} f \, d \mu = 0$ for every $E \in \mathcal{M} \Longleftrightarrow f=0 \ \ \text{a.e in} \ X$, where $f=w_1-w_2$. So consider the set $\{ w_1=w_2=+\infty \} \cup \{ w_1 < +\infty, w_2=+\infty \} \cup \{ w_1=+\infty, w_2 < +\infty \}$. On the first set, $w_1=w_2$ and we are done; wlog consider the third one and call it $A$. We have $\{ f > n \} \cap A \downarrow \{ f=+\infty \} \cap A = A$, on the other hand $\mu\{ f > n \} \le \frac{1}{n} \int_{A} f \, d \mu = 0$, thus $\mu(A)=0$. Is this proof correct? By the way, a doubt still remains: the statement is actually false if $\mu$ is not $\sigma$-finite, but where do we use the $\sigma$-finiteness throughout the proof (assuming, of course, that this proof is correct)?