Bounded variation For every $x \in \mathbb{R}$ define
$$I(x) = \begin{cases}0 & \text{if } x \leq 0\\1 & \text{if } x > 0\end{cases}$$
Suppose that $(x_n)$ is a sequence of distinct points in (a, b) and that the series $\sum_{n = 1}^\infty c_n$ converges absolutely. Define $f(x) = \sum_{n = 1}^\infty c_n I( x - x_n)$. Show that $f$ is a function of bounded variation and that $V_a^b f = \sum_{n = 1}^\infty |c_n|$.
It is easy to show that $f$ is a function of bounded variation with $V_a^b f \leq \sum_{n = 1}^\infty |c_n|$. But I am unsure of how to prove equality.
I was wondering if I could get a hint.
Thanks!
 A: Let $\epsilon>0$ and fix $N$ such that $\sum\limits_{i=N+1}^\infty |c_i|<\epsilon$. 
Let $(z_i)_{i=1}^N$ be the increasing rearrangement of $(x_i)_{i=1}^N$. 
Choose  $0<\delta<\min\limits_{2\le i\le N}|z_i-z_{i-1}|$ and
let  $(y_i)_{i=0}^N$ be defined by 
$$
y_i=\cases{a,&$i=0$\cr b, &$i=N$\cr z_i+\delta,&$1\le i<N$. }
$$ 
Note that 
$$
f(y_{i })-f(y_{i-1})= c_{i^*}+\sum_{\scriptstyle {y_{i-1}\le x_k<y_i}\atop\scriptstyle k\ne i^* } c_k;
$$
where $i^*$ is such that $x_{i^*}=z_{i}$.
We thus have
$$
|f(y_i)-f(y_{i-1})|\ge |c_{i^*}|-\sum_{\scriptstyle y_{i-1}\le x_k<y_i \atop\scriptstyle k\ne i^*} |c_k|.
$$
From this it follows that
$$
\sum_{i=1}^N 
|f(y_i)-f(y_{i-1})|\ge \sum_{i=1}^N|c_i|-\sum_{i=1}^N\sum_{\scriptstyle y_{i-1}\le x_k<y_i\atop\scriptstyle k\ne i^* } |c_k|.
$$
Now
$$
\sum_{i=1}^N\sum_{ \scriptstyle y_{i-1}\le x_k<y_i\atop\scriptstyle k\ne i^*} |c_k|= \sum_{i=N+1}^\infty |c_i|<\epsilon;
$$
and so
$$
\sum_{i=1}^N 
|f(y_i)-f(y_{i-1})|\ge \sum_{i=1}^N|c_i|-\epsilon.
$$
As $\epsilon$ was arbitrary, it follows that $V_a^b f\le\sum\limits_{n=1}^\infty|c_n|$.
