Show $\lvert\,f(x)-f(y)\,\rvert \leq 2\,\lvert\,x-y\,\rvert$ for Lebesgue measure Having some trouble with Borel algebra understanding
My textbook says, let $\lambda$ be the Lebesgue measure on $\mathbb{R}$ and let $A \in \mathcal{B}(\mathbb{R})$. Define a function f: $[0,\infty)\rightarrow \mathbb{R}$ by f(x)=$\lambda(A \cap [-x,x])$
Show that $\lvert\,f(x)-f(y)\,\rvert \leq 2\,\lvert\,x-y\,\rvert$.
My ideas are:


*

*$|\lambda(A \cap [-x,x])-\lambda(A \cap [-y,y])|=|\lambda(A \cap \cap_{n=1}^\infty (-x-1/n,x+1/n))-\lambda(A \cap \cap_{n=1}^\infty (-y-1/n,y+1/n))|$

*$|\lambda(A \cap [-x,x])-\lambda(A \cap [-y,y]|=|\lambda((-x,x))-\lambda(A \cap (-y,y))|$
Not sure if either are correct. It says that the Boreal algebra is the collection of all open sets (equivalent closed sets). 
But does this mean that I should write $[-x,x]$ as a union of open sets (1) so that they can be joined with A. Or does it mean that $[-x,x]$ becomes $(-x,x)$ (2) because there are only open sets in the Borel algebra
 A: If $x>y$, then 
$$
f(x)-f(y)=\lambda((A\cap[-x,-y))\cup(A\cap(y,x]))
\leq\lambda([-x,-y)\cup(y,x])=\lambda([-x,-y))+\lambda((y,x])=2(x-y)
$$
and the argument for $x<y$ is similar with the roles of $x$ and $y$ reversed.
A: I suppose that $A$ should be Borel-measurable, should it? Otherwise I don't see where the Borel-Sigma-Algebra comes into place in you exercise. But it is not needed for the proof. You just have to assume that $A$ is Lebesgue-measurable in order to have the measure of it defined.
Nevertheless, the Borel-Sigma-Algebra is the smallest Sigma-Algebra which contains all open sets (or equivalently all closed sets). This means that it contains much more than just all open sets, in particular it also contains all closed sets because every closed set is the complement of an open set and a Sigma-Algebra is closed under complements.
To prove your estimation you can assume wlog that $y > x$ and then $A \cap [-x,x] \subseteq A \cap [-y,y]$ and therefore $$|f(y)-f(x)| = \lambda(A \cap [-y,y]) - \lambda(A \cap [-x,x]) = \lambda((A \cap [-y,y]) \setminus (A \cap [-x,x])) = \lambda((A \cap [-y,-x]) \cup (A \cap [x,y])) \leq \lambda([-y,-x] \cup [x,y]) = 2|y-x|$$
