What will be the supremum of $S(P)$ taken over all possible partitions $P$. Let $f\in C^1[0,1]$. For a partition $(P):\{0=x_0<x_1<...<x_n=1\}$
Define $S(P)=\sum _{i=1}^n |f(x_i)-f(x_{i-1})|.$
Compute the supremum of $S(P)$  taken over all possible partitions $P$.
By the Mean-Value Theorem we have:-
$\sum _{i=1}^n |f(x_i)-f(x_{i-1})|=\sum _{i=1}^n|f^{'}(c_i)||x_i-x_{i-1}|$ where $c_i\in (x_{i-1},x_i)$
How to take the supremum over all the partitions??Please help.
 A: Ok, I have the two inequalities now.
Back to the first one, for every partition $P$,
$$S(P)=\sum_{i=1}^n\left|\int_{x_{i-1}}^{x_i}f'(t)dt\right|\leq \sum_{i=1}^n\int_{x_{i-1}}^{x_i}\left|f'(t)\right|dt=\int_{0}^{1}\left|f'(t)\right|dt$$
So $\sup_P S(P)\leq \int_{0}^{1}\left|f'(t)\right|dt$.
For the other inequality, you need to know a bit about Riemann's sum. Let's take $x_i=i/n$ where $n\in\mathbb{N}^*$, so that $P_n=(x_i)_{0\leq i\leq n}$ is the uniform partition of size $1/n$.
Then it is classical that 
$$\sum_i g(c_i)(x_{i}-x_{i-1})\mathop{\longrightarrow}_{n\to\infty} \int_0^1g(t)dt,$$
(say, if $g$ is continuous), where $\forall i, c_i\in(x_{i-1},x_i)$.
(to see this, write
$$\left|\sum_i g(c_i)(x_{i+1}-x_{i})-\int_0^1g(t)dt\right|=\left|\sum_i \int_{x_{i-1}}^{x_i}\left(g(c_i)-g(t)\right)dt\right|\leq\sum_i \int_{x_{i-1}}^{x_i}\left|g(c_i)-g(t)\right|dt,$$
and use the uniform continuity of $g$ to see that for $n$ large enough, this value is small).
As you mentioned, you apply the mean-value theorem and the above result with $g=|f'|$.
As $S(P_n)$ converges to $\int_0^1|f'(t)|dt$, you have $\sup_P S(P)\geq \int_0^1|f'(t)|dt$, which gives the equality.
As I mentioned in my previous comment, if you don't necessarily assume $f$ of class $C^1$, you call the class of $f$ such that $S$ is bounded from above among every partitions, the set of functions of bounded variations, and the value of the supremum is called the total variation of $f$. We just proved that if $f$ is $C^1$, then it is of bounded variation, and the value of the total variation is $\int |f'|$. But it contains much more (including non-continuous functions).
A very beautiful result is that a function is of bounded variation, if and only if it is the difference of two non-decreasing functions.
