The definition of total variation of a complex measure $\mu $, where $ (X, \mathfrak M, \mu ) $ is a measure space is
$$ |\mu|(E) := \sup\left\{ \sum_{i=1}^\infty |\mu (E_i)| \right\} \text{ for all } \{ E_i \}_{i \in \mathbb N} \text{ partition of } E. $$
I need to prove that
$$|\mu|(E) = \sup\left\{ \left| \int_E f\,d\mu \right| ; |f|\leq 1 , \text{ a.e.}[\mu] \right\}$$
my idea is to use that
$$ |\mu|(E) := \sup\left\{ \sum_{i=1}^n |\mu (E_i)| \right\} \text{ for all } \{ {E}_i \}_{i = 1}^n \text{ finite partition of } E .$$
this will make it easier because we only need to work with finite sums
set $$A:= \left\{\alpha \in \mathbb R ; \; \alpha = \sum_{i=1}^n |\mu (E_i)|, \{ E_i \}_{i = 1}^n \text{ finite partition of } E \right\} $$
$$B:= \left\{\beta \in \mathbb R ; \; \beta = \left|\int_E f \, d\mu \right| ; |f|\leq 1, \text{ a.e.}[\mu] \right\} $$
and prove that $\sup(A) = \sup(B)$.
for the inequaliry "$\leq$" I know that it suffices to show that for every $ \alpha \in A$ there is $ \beta \in B $ such that $ \alpha \leq \beta$. Then
If $ \alpha \in A$ then $\alpha = \sum_{i=1}^{n} |\mu (E_i)|$, for some $ \{ {E}_i \}_{i = 1}^n $ finite partition of $ E $
but
$$\chi_E = \chi_{E_1} + \chi_{E_2} + \cdots + \chi_{E_n}$$ and $|\chi_{E}| \leq 1.$
from that point I could not make progress.
"$\geq$" I do not know how to proceed.
A standard result involving $|\mu|$ is $|\int f d\mu|\leq \int |f|d|\mu|$. This gives $\beta \leq \alpha$ immediately. For $\alpha \leq \beta$ use the function f which has the constant value $\frac {|\mu(E_i)|} {\mu(E_i)}$ on the set $E_i$ in the given partition. This works even if the partition is infinite.