why $\sigma$ finite is necessary to show that $f=g$ a.e.? Let $(X, \mathcal{B}, m)$ be the measure space,show that if the measure is $\sigma$ finite,we have for any $f, g: X \to [0,+\infty]$
We have $$\int_X 1_E f\ dm = \int_X 1_E g\ dm $$
for any $E\in \mathcal{B}$ if and only if  $f = g$ a.e.
We can prove by this if $f,g\in L^1$ then the result above holds for $f$ and $g$ since we can subtract $\int_X 1_E g\ dm$ to the otherside.For $\sigma$ finite case just restrict the measure on each pieces of the partition and we know one each pices the result holds so globally the result holds.
The question is why $\sigma$ finite is necessary here?
If taking $f = \chi_{x}$ and $g = 2\chi_{x}$ then we can construct the measure that $\delta({x}) = \infty$ and $X=\{x\}$ then $\int_X 1_E f\ d\delta = \int_X 1_E gd\delta = \infty$ correct?
 A: I assume that $f$ and $g$ shall both be measurable, so that the integrals are well-defined.
$\sigma$-finiteness is a stronger property than necessary to have the conclusion. As your example shows, some assumption has to be made about $m$. The necessary and sufficient assumption is that $m$ be semi-finite, i.e. that for every $A \in \mathcal{B}$ with $m(A) = \infty$ there is an $F \in \mathcal{B}$ with $F \subset A$ and $0 < m(F) < \infty$. Informally, $m$ shall have no atoms of infinite measure.
The necessity is essentially shown by your example, of course we need to adapt it to the general situation. If $m$ is not semi-finite, then there is $A \in \mathcal{B}$ with $m(A) = \infty$ such that for every measurable $B \subset A$ either $m(B) = 0$ or $m(B) = \infty$. Then taking $f = \chi_A$ and $g = 2\cdot \chi_A$ works. We have
$$\int f\chi_E\,dm = \int g\chi_E\,dm = 0$$
if $m(E\cap A) = 0$, and both integrals are $\infty$ if $m(E\cap A) = \infty$.
To see sufficiency, suppose $f$ and $g$ differ on a set of nonzero measure. Without loss of generality suppose $A = \{x : f(x) > g(x)\}$ has positive measure. If $A' = \{ x \in A : f(x) < \infty\}$ has positive measure, then there is an $n \in \mathbb{N}$ such that $A'' = \{x \in A' : g(x) < n,\, 0 < f(x) - g(x) < n\}$ has positive measure, and by semi-finiteness there is a measurable $B \subset A''$ with $0 < m(B) < \infty$. Then
$$\int_B f\chi_B\,dm > \int g\chi_B\,dm\,.$$
If $m(A') = 0$, then for some $n$ the set $A''' = \{x \in A : g(x) < n\}$ has positive measure and there is $B \in \mathcal{B}$, $B \subset A'''$ with $0 < m(B) < \infty$. Again $\int g\chi_B\,dm < \int f\chi_B\,dm$.
The converse direction, $f = g$ a.e. implies $\int f\chi_E\,dm = \int g\chi_E\,dm$ for all $E \in \mathcal{B}$, holds without any assumptions on the measure.
The reason that $\sigma$-finiteness was given as the (sufficient) assumption is probably that $\sigma$-finiteness is a better-known property, and one mostly cares about $\sigma$-finite measures anyway, thus in practice not much is lost by choosing the stronger assumption.
