Given $f \colon [a,b] \to \mathbb{R}$ and $\mathcal{P} \colon a = x_0 < \cdots < x_m = b$ a partition of $[a,b]$. We define three possible variations for $f$:
$P_a^b(f) = \sup\{p(f, \mathcal{P}) \mid \mathcal{P}$ is a partition of $[a,b]\}$
$N_a^b(f) = \sup\{n(f, \mathcal{P}) \mid \mathcal{P}$ is a partition of $[a,b]\}$
$T_a^b(f) = \sup\{t(f, \mathcal{P}) \mid \mathcal{P}$ is a partition of $[a,b]\}$
We call them positive, negative and total variation, respectively. They depend on the definition of the following:
$p(f, \mathcal{P}) = \sum_{i=1}^m [f(x_i)- f(x_{i-1})]^+$
$n(f, \mathcal{P}) = \sum_{i=1}^m [f(x_i)- f(x_{i-1})]^-$
$t(f, \mathcal{P}) = \sum_{i=1}^m |f(x_i)- f(x_{i-1})| = p(f, \mathcal{P}) + n(f, \mathcal{P})$
We say that $f$ has bounded variation if $T_a^b(f)$ is finite.
My question is: given $E \subset [0,1]$ a measurable set and $f \colon [0,1] \to \mathbb{R}$ defined by $$f(x) = \int_{[0,x]} (1 - 2\chi_E(t))dt$$ where the integral is the Lebesgue integral. How should I go about finding all the variations of $f$ over $[0,1]$?