What can I get from measure $0$ set? I'm having issues with this problem:
Let $f:[0,1]\rightarrow[0,1]$ injective and continuous function. Let A=$\bigcup_i (a_i,b_i)$ 


*

*$\forall x_1, x_2 \in (a_i,b_i)$, $|f(x_1)-f(x_2)|\leq |x_1-x_2|$

*$f([0,1]\setminus A)$ has Lebesgue measure $0$


I have to show $\forall x_1, x_2 \in [0,1]$, $|f(x_1)-f(x_2)|\leq |x_1-x_2|$.
What I know: 
I noticed that $[0,1]\setminus A$ needs to have empty interior.
Moreover, $f$ has to be increasing (because of continuity and injectivity).
I also noticed that it has to work in the for $x_1,x_2\in [a_i,b_i]$.
This leads me to believe that I can get more out of the $0$ measure, am I missing something?
 A: Let $g = f^{-1}. $Suppose to the contrary that there are $x_1, x_2$ in $f([0,1])$, such that $$|x_1-x_2| = |g(x_1)-g(x_2)|+\epsilon,$$ where $\epsilon>0$. 
If $x_1$ and $x_2$ are both in $B:=f([0,1]\setminus A)$, there's an open covering $\bigcup_i (c_i,d_i)$ of $B$ with total length less than $\delta$. Since $f([0,1])$ is an interval, there's $x_1',x_2' \in f(A)$ such that $|x_i-x_i'|<\delta$. With appropriate choice of $\delta$, this leads to $|g(x_i)-g(x_i')|<\frac{\epsilon}{4}$. Note that $$|x_1'-x_2'| \le |g(x_1')-g(x_2')|$$ and $$|g(x_1')-g(x_2')| \le |g(x_1)-g(x_2)|+\frac{2}{4}\epsilon=|x_1-x_2|-\frac{1}{2}\epsilon.$$ Now if $ \delta < \frac{\epsilon}{6}$ we get $$|g(x_1')-g(x_2')| < |x_1'-x_2'|, $$ a contradiction. The other case where only one of $x_i$ is in $B$ is similar.
A: New Answer. We attempt a more direct proof. As in the old answer, we may assume that $(a_j, b_j)$ are disjoint.

Claim. If $E \subseteq A$, then $m^*(f(E)) \leq m^*(E)$, where $m^*$ is the outer measure.

Indeed, for each countable family $\{I_i\}$ of intervals covering $E$, let
$$ \tilde{I}_{i,j} =  I_i \cap (a_j, b_j). $$
Then we find that


*

*$\{\tilde{I}_{i,j} \}$ is a countable family of intervals covering $E$,

*$\{f(\tilde{I}_{i,j}) \}$ is a countable family of intervals covering $f(E)$,

*$|f(\tilde{I}_{i,j})| \leq |\tilde{I}_{i,j}|$.


From this, it follows that
$$ m^*(f(E))
\leq \sum_{i,j} |f(\tilde{I}_{i,j})|
\leq \sum_{i,j} |\tilde{I}_{i,j}|
\leq \sum_{i} |I_i|. $$
Taking infimum over all possible $\{I_i\}$ yields the desired inequality and thus completes the proof of the claim. Returning to our problem, for each $0 \leq x_1 \leq x_2 \leq 1$ we have
\begin{align*}
|f(x_2) - f(x_1)|
&= |f([x_1, x_2])| \\
&\leq m^*(f([x_1, x_2]\cap A)) + m^*(f([x_1, x_2]\setminus A)) \\
&\leq m^*([x_1, x_2]\cap A) + 0 \\
&\leq |x_1 - x_2|.
\end{align*}

Old Answer. Without loss of generality, we may assume the followings:


*

*$f$ is strictly increasing.

*$(a_i, b_i)$ are disjoint.


Also we write $N = [0, 1]\setminus A$ for convenience.
Now for each $0 \leq x_1 < x_2 \leq 1$, notice that $f([x_1, x_2] \cap N)$ is both compact and measure-zero. Thus for each $\epsilon > 0$ there are finitely many open intervals $J_1, \cdots, J_m$ such that
$$\sum_{i=1}^{m} |J_i| < \epsilon, \qquad f([x_1, x_2] \cap N) \subset \bigcup_{i=1}^{m} J_i. $$
We may assume as well that $J_1, \cdots, J_m$ are disjoint and indexed in such a way that $J_i$ lies left to $J_{i+1}$ for each $i = 1, \cdots, m-1$. This allows us to choose points
$$x_1 = p_1 \leq q_1 < p_2 < q_2 < \cdots < q_{m-1} < p_m \leq q_m = x_2$$
such that
\begin{align*}
[f(p_1), f(q_1)) &= J_1 \cap f([x_1,x_2]), \\
(f(p_i), f(q_i)) &= J_i \hspace{2em} \text{for } i = 2, \cdots, m-1, \\
(f(p_m), f(q_m)] &= J_m \cap f([x_1,x_2]).
\end{align*}
Thus for each $i = 1, \cdots, m-1$, we have $[q_i, p_{i+1}] \subset A$ and hence it lies in one of $(a_j, b_j)$. This gives the following estimate:
\begin{align*}
f(x_2) - f(x_1)
&= \sum_{i=1}^{m-1} (f(p_{i+1}) - f(q_i)) + \sum_{i=1}^{m-1} (f(q_{i}) - f(p_i)) \\
&\leq \sum_{i=1}^{m-1} (p_{i+1} - q_i) + \epsilon \\
&\leq (x_2 - x_1) + \epsilon.
\end{align*}
Since $\epsilon$ was arbitrary, letting $\epsilon \to 0^+$ yields $|f(x_2) - f(x_1)| \leq |x_2 - x_1|$.
