Suppose $f$ is a bounded function on $[a,b]$, its total variation is defined to be $$ \mathrm{Var}(f) = \sup_{\tau} \sum_{i=1}^{n} |f(x_{i})-f(x_{i-1})|. $$ Furthermore, if $f$ is continuous on $[a,b]$, it can be proved that $$ \mathrm{Var}(f) = \lim_{|\tau|\to 0}\sum_{i=1}^{n} |f(x_{i})-f(x_{i-1})|, $$ where $|\tau|$ denotes the mesh of the partition $\tau$.
When $f$ is discontinuous, can anyone give a counterexample to the above equality, that is the total variation cannot always be calculated by letting the mesh approaching zero?