Two problems about Riemann integrals These are the problems, that I can´t do, from my book. They are interesting. Please help me.

i) Let $f\colon[a,b] \to \mathbb{R}$ be Lipschitz (in particular, it is $\mathcal{C}^1$). If $
X \subset [a,b]
$ has null measure, then $f(X)$ has null measure.
ii) Show that if $
f,g:[a,b] \to \mathbb{R}$ are
  Riemann-integrable, and the set 
  $$
X = \left\{x\ \left|\ f(x) \ne g( x)\right\}\right.
$$ 
  has measure zero, then 
  $$\int_a^b f( x )\,dx  = \int_a^b g( x )\,dx$$ 
  where the integrals are the Riemann integrals.

Here's one thought: separate the integration zone into $X$ and $[a,b]-X$, but in Riemann integrals, this may not make sense. We integrate only on intervals. 
I'm very confused with this problem, and I don´t know how to do it formally
 A: Ad i): Let $L>0$ be a Lipschitz constant for $f$ and let $I$ be an arbitrary subinterval of $[a,b]$. Put $\alpha:=\inf_{x\in I}f(x)$ and $\beta:=\sup_{x\in I}f(x)$. Then $f(I)\subset I':=[\alpha,\beta]$ and $$|I'|=\beta-\alpha\leq \sup_{x,y\in I}|f(y)-f(x)|\leq L\>|I|\ .\qquad(*)$$
If $X\subset [a,b]$ is a set of measure zero then for any given $\epsilon>0$ there is a collection of intervals $I_k\subset [a,b]$ with $X\subset\bigcup_k I_k$ and $\sum_k|I_k|\leq \epsilon/L$. To each $I_k$ corresponds an $I_k'$ with $f(I_k)\subset I_k'$ and $|I_k'|\leq L\>|I_k|$. Therefore
$f(X)\subset\bigcup_k I_k'$, and according to $(*)$ one has $\sum_k|I_k'|\leq\epsilon$.
Ad ii): Given an $\epsilon>0$ there is a partition $[a,b]=\bigcup I_k$   of $[a,b]$ such that for any choice of sampling points $\xi_k\in I_k$ one has
$$\Bigl|\int_a^b f(x)\ dx-\sum_k f(\xi_k)\ |I_k|\Bigr|<\epsilon,\qquad 
\Bigl|\int_a^b g(x)\ dx-\sum_k g(\xi_k)\ |I_k|\Bigr|<\epsilon\ .$$ As $X$ has measure zero one can choose the  $\xi_k\in I_k$ such that $f(\xi_k)=g(\xi_k)$. But then  the corresponding Riemann sums for $f$ and for $g$ coincide. It follows that $|\int_a^b f(x)\ dx -\int_a^b g(x)\ dx|<2\epsilon\ $, and as $\epsilon>0$ was arbitrary we conclude that the two integrals have the same value.
A: i)Every Lipschitz function is absolutely continuous.
ii)The value of the difference (f(x)-g(x)), if finite, is bounded by Max(f(x)-g(x)).m(X). The infinite case is similar.
A: This is just a hint, but a little too long for a comment. 
I haven't verified it, but here's how I would approach the first one:


*

*Take a countable collection as in the definition

*prove that $f(I_k)$ is an interval for every $k$

*prove an inequality of the form $\sum_{k\in\mathbb{N}}|f(I_k)|\leq\ldots<C\epsilon$, where $C$ is some positive constant.

*Turn this into a proof by applying the definition (first step) to $\epsilon/C$ instead of $\epsilon$ 

