Ex2-4

Chapter 2 Question 4 
Question: Let \{f_k\} be a sequence of functions of bounded variation on [a,b]. If V[f_k;a,b]\leq M<+\infty for all k and if f_k\to f pointwise on [a,b], show that f is of bounded variation and that V[f;a,b]\leq M. Give an example of a convergent sequence of functions of bounded variation whose limit is not of bounded variation. 
Proof: Given \varepsilon>0, suppose \Gamma=\{x_0,x_1,\ldots,x_n\} is any partition of [a,b], then for each i=0,1,\ldots,nwe can choose a natural number K_isuch that 
|f_k(x_i)-f(x_i)|<\frac\varepsilon{2n} \quad\forall k\geq K_i.
(We will see why there is 2n inside the fraction later)
By letting K=\max\{K_0,K_1,\ldots,K_n\}, we have
|f_k(x_i)-f(x_i)|<\frac\varepsilon{2n}\quad\forall i=0,1,\ldots,n, \forall k\geq K.
We find that 
\begin{align} S_\Gamma[f]&=\sum_{i=1}^n |f(x_i)-f(x_{i-1})|\\
&\leq \sum_{i=1}^n \{|f_K(x_i)-f_K(x_{i-1})|+|f_K(x_i)-f(x_i)|+|f_K(x_{i-1})-f(x_{i-1})|\}\\
&< \sum_{i=1}^n \left\{|f_K(x_i)-f_K(x_{i-1})|+\frac\varepsilon n\right\}\\
&= S_\Gamma[f_K]+\varepsilon\\
&\leq M+\varepsilon.\end{align} 
Since \varepsilon is arbitrary, we conclude S_\Gamma[f]\leq M for each partition \Gamma of [a,b], thus the proof is complete.
What if the variations do not bounded above uniformly?
Define a sequence \{f_k\}_{n=1}^\infty of functions on [0,1] such that 
 f_k(x)=\begin{cases}1&\text{ if }0<x\leq \frac1{2^k},\\0&\text{ otherwise}.\end{cases}
We also define a sequence \{g_n\}_{n=1}^\infty on [0,1] such that 
g_n(x)=\sum_{k=1}^n f_k(x).
Clearly, each function f_k is of bounded variation with variation V[f_k;0,1]=2, so each g_n being a finite sum of functions of bounded variation, is also of bounded variation. One can check that V[g_n;0,1]=2n for all n. Now \{g_n\}_{n=1}^\infty is a sequence of functions of bounded variation. We prove this sequence has a pointwise convergence to a function g. It is clear that g(0)=0 since g_n(0)=0 for all n. For x\in(0,1] we can choose nonnegative integer N such that \frac1{2^{N+1}}<x\leq \frac1{2^N}, hence 
g(x)=\lim_{n\to\infty}g_n(x)=\sum_{k=1}^N f_k(x)=N
since f_k(x)=0 for k>N.
Note that for each positive integerN, there is always a positive number x such that x\leq 1/2^N, therefore g is unbounded and therefore it is not a function of bounded variation by Theorem 2.1(i).