Let $f:[0,1]\to \mathbb{R}$ be Lebesgue measurable. How to prove that for every $0<\epsilon<1$ there is $\delta>0$ and $A\subset [0,1]$ with $m(A)>1-\epsilon$ such that $$|f(x)-f(y)|<\epsilon, \forall x,y\in A \text{ with } |x-y|<\delta?$$
($m$ denotes Lebesgue measure)