Variation of Dirichlet's function [duplicate]

I am to prove that the variation of Dirichlet's function is infinite. I would really appreciate any help, because I do not know how to start.
$$f(x)= \begin{cases} 1 & \text{if x\in\mathbb{Q}}\\ 0 & \text{if  x \notin\mathbb{Q}} \\ \end{cases}$$

Observe that since the function will wiggle uncountable infinite number of times and hence the variation when summed up will be infinite ,

Mathematically , for calculating the variation of any function over a set,

First we partition the underlying domain set and sometimes partition the subset of the domain set (as, if we see that the variation of that function on the subset is infinite then it is clear that variation of the function over whole domain set will still be infinite).

So let us consider a subset $A \subset [0,1]$ and we do the partition of $A$ like this - $\{0=x_{0},x_{1},...,x_{n-1}\}$,such that $x_{i}$ is irrational if $i$ is even and $x_{i}$ is rational if $i$ is odd .

Now for finding the variation of the above Dirichlet function on set $A$ consider the total variation $t[\{0,x_{1},...,x_{n-1}\}](f) = \sum_{i=1}^{n}|(f(x_{i}) - f(x_{i-1}))|$ .

Now since if $i$ is even then $i-1$ will be odd so we will get a sum of $1's$ $n$ times giving $t[\{0,x_{1},...,x_{n-1}\}] = n$ and when $n \rightarrow \infty$ this total variation tends to infinity .

And since this is for a subset of $[0,1]$ , so the variation of Dirichlet function on the set $[0,1]$ is infinite.

Hope this helps!

• I think it helped, but I have one question. Subset $A$ is finite, isn't it? Thus how $n$ can tend to $\infty$? Commented Mar 7, 2017 at 20:37
• And where is the $sup$ in variation's definition? Commented Mar 7, 2017 at 20:48
• Actually we are taking more number of partitions,i think even in a finite set you can do infinite number of partitions ... as an intuition a partition such that the $x_{i}$'s are irrational , and such are infinite in numbers in any interval in $\mathbb{R}$ @Hendrra Commented Mar 8, 2017 at 0:57
• ${T_{a}}^{b}(f) =$sup ${t({x_{0},x_{1},...,x_{n}})(f)}$ , and $t \rightarrow \infty$ as $n \rightarrow \infty$ , thus ${T_{a}}^{b}(f)$ too isinfinite. @Hendrra Commented Mar 8, 2017 at 1:02