# Subset $A\subset\mathbb R$ such that for any interval $I$ of length $a$ the set $A\cap I$ has Lebesgue measure $a/2$

Is there a subset $A\subset\mathbb R$ such that for any interval $I$ of length $a$ the set $A\cap I$ has lebesgue measure $a/2$?

Can it be constructed explicitly?

You can use Lebesgue's density theorem. If such a set exists then for every point of $A$ the Lebesgue density would be $\frac{1}{2}$. Since, by Lebesgue's theorem the Lebesgue density must be $0$ or $1$ almost everywhere this is a contradiction.