$x^2$ with removable discontinuities has bounded variation Define
$$f(x) = \begin{cases}0 & \text{ if } x=1/n \text{ for some } n\in\mathbb{N}
\\x^2 & \text{ else}\end{cases}$$
on $[0, 1].$ I want to show that this has bounded variation. It is straightforward to show that $x^2$ has bounded variation on $[0,1]$, but the discontinuities at $1/n$ cause problems. I was thinking of splitting up the variation over the interval $[0,1]$ into the variation over each subinterval $[1/n, 1/(n+1)]$ as follows:
$$V_{[0,1]}(f) = \sum_{n=1}^\infty V_{[1/n, 1/(n+1)]}(f) = 2\sum_{n=1}^\infty \frac{1}{n^2} <\infty.$$
However, I'm stuck in proving the first equality. In fact, I'm not even completely sure that it is true. Any help would be appreciated.

The total variation of a differentiable function $f(x)$ on the interval $[a.b]$ is
$$V_b^a(f)=\int_a^b \left| f'(x)\right|  \, dx$$
The function $f(x)=x^2$ on intervals $\left(\frac{1}{n+1},\frac{1}{n}\right)$ has variation
$$\int_{\frac{1}{n+1}}^{\frac{1}{n}} 2 x \, dx=\frac{1}{n^2}-\frac{1}{(n+1)^2}$$
The sum of these variations is
$$ \sum _{n=1}^{\infty }\left( \frac{1}{n^2}-\frac{1}{(n+1)^2}\right)=1$$
Look here for further details.
This result fits with intuition, actually. The function goes from $0$ to $1$ and the total variation is $1$
