How to prove that an Absolutely continuous function admits weak derivative?
Absolutely continuous function: Let $(X, d)$ be a metric space and let I be an interval in the real line R. A function $f: I → X$ is absolutely continuous on I if for every positive number $\epsilon$, there is a positive number \delta such that whenever a finite sequence of pairwise disjoint sub-intervals $[x_k, y_k]$ for $k=1,2,...m$ of I satisfies
$$\sum_{k} \left| y_k - x_k \right| < \delta$$ then
$$\sum_{k} d \left( f(y_k), f(x_k) \right) < \epsilon.$$
If $f$ is an Absolutely continuous on $[a,b]$, then $f$ admits weak derivative $f'$ in $L^1([a,b])$ that is
$$ \int_a^b f(t) g'(t)dt=-\int_a^b f'(t)g(t)dt .......................(1)$$
for all absolutely continuous functions $g$.
I know that I have to use integration by parts and it is holds for absoltely continuous functions $f$ and $g$ (obvious),
$$ \int f(x) g'(x) \, dx = fg(b)-fg(a) - \int f'(x) g(x) \, dx ......(2) $$ My question is how to get (1) from (2).