Question on Riemann sums Question is :

What I have read in Riemann sum definition is something like $$\sum_{i=1}^n f(y) .|x_i-x_{i-1}|$$
So, at first sight i am afraid this is not even related to Riemann integration of $f$ and then I got something like :
$|f(x_i)-f(x_{i-1})|$ being seen as 
$$\frac{|f(x_i)-f(x_{i-1})|}{|(x_i-x_{i-1})|}.|(x_i-x_{i-1})|$$
and this is same as $$f'(y_i) |x_i-x_{i-1}|\text{for some $y_i \in (x_{i-1}, x_i)$}$$
So, I would now be left with 
$$S(P)=\sum_{i=1}^n |f(x_i)-f(x_{i-1})|=\sum_{i=1}^n\frac{|f(x_i)-f(x_{i-1})|}{|(x_i-x_{i-1})|}.|(x_i-x_{i-1})|=\sum_{i=1}^nf'(y_i) |x_i-x_{i-1}|$$
and i see this is Riemann sum for $f'(x)$ on $[0,1]$
So, I would like to say that $$S(P)= \int_{0}^1 |f'(x)|$$
I am brand new for this Riemann integration problems (this might be third of fourth problem i have tried in this topic).
So, I would be thankful if some one can assure my reasons for this problem are correct and precise.
Thank you
 A: Your reasoning contains some heuristics supporting the conjecture
$$\sup_{\cal P} S({\cal P})=\int_a^b |f'(x)|\ dx\ ,\tag{1}$$
but is far away from a proof. Note that "sup" does nowhere show up in your argument.
First the easy part. Let a ${\cal P}$ be given. Then
$$\bigl|f(x_i)-f(x_{i-1})\bigr|=\left|\int_{x_{i-1}}^{x_i} f'(x)\ dx\right|\leq \int_{x_{i-1}}^{x_i} \bigl|f'(x)\bigr|\ dx\ .$$
Summing over $i$ gives
$$S({\cal P})\leq\int_a^b |f'(x)|\ dx\ .$$
Since this is true for all ${\cal P}$, the $\leq$ in $(1)$ is proven.
For the converse inequality we need the (uniform) continuity of $f'$. Let an $\epsilon>0$ be given. Then we can find a partition ${\cal P}$ of $[a,b]$ such that for each subinterval $I_i:=[x_{i-1},x_i]$ one has
$$\bigl|f'(s)-f'(t)\bigr|\leq\epsilon\qquad \forall s,\>t\in I_i\ .$$
It easily follows that
$$\int_{x_{i-1}}^{x_i}\bigl|f'(x)\bigr|\ dx\leq\bigl(\bigl|f'(x_i)\bigr|+\epsilon\bigr)(x_i-x_{i-1})\ .\tag{2}$$
On the other hand we can write
$$f'(x_i)(x_i-x_{i-1})=f(x_i)-f(x_{i-1})+\int_{x_{i-1}}^{x_i}\bigl(f'(x_i)-f'(x)\bigr)\ dx\ ,$$
which implies
$$\bigl|f'(x_i)\bigr|(x_i-x_{i-1})\leq\bigl|f(x_i)-f(x_{i-1})\bigr|+\epsilon(x_i-x_{i-1})\ .\tag{3}$$
Taking $(2)$ and $(3)$ together we obtain
$$\int_{x_{i-1}}^{x_i}\bigl|f'(x)\bigr|\ dx\leq \bigl|f(x_i)-f(x_{i-1})\bigr|+2\epsilon(x_i-x_{i-1})\ ,$$
and summing over $i$ gives
$$\int_a^b |f'(x)|\ dx\leq S({\cal P})+2\epsilon(b-a)\ .$$
A fortiori
$$\int_a^b |f'(x)|\ dx\leq \sup_{\cal P}S({\cal P})+2\epsilon(b-a)\ ,$$
and as $\epsilon>0$ was arbitrary we also get the $\geq$ in $(1)$.
