Find a measurable set A$\subset(-1,1)$ such that $f(x)=m(A\cap(-1,x))$ has $f'(0)=1/2$ Now, I have done some work on this and by using the definition of the derivative, I come to the conclusion that if such a set $A$ exists, then I should have
\begin{align*} \lim\limits_{x\rightarrow0^{+}}\frac{m(A\cap(0,x))}{x} = \frac{1}{2} = \lim\limits_{x\rightarrow0^{-}}\frac{-m(A\cap(x,0))}{x} 
\end{align*}
But now, I tried to create such an $A$ in the following way: $A = \bigcup \limits_{n=1}^{\infty} (\frac{1}{2^n}, \frac{3}{2^{n+1}})$. The idea was, that if I took an interval of measure $\frac{1}{2^{n+1}}$ in each interval $(\frac{1}{2^n}, \frac{1}{2^{n+1}})$, then eventually I could have 'half' of $(0,x)$ in each $A\cap(0,x)$ set, as the limit requires. Note that I'm working only for the part $x>0$, if I manage this I think that by symmetry it will work out in the $x<0$ part too. But I cannot prove that for this $A$ the limit is indeed $\frac{1}{2}$, so I'm not sure I'm on the right path.
 A: Divide the interval $[2^{-k-1}, 2^{-k}]$ into $N(k)$ subintervals which are alternately included in $A$ or excluded from it.  Then the difference quotient $(f(x) - f(0))/x$ for $x$ in the first subinterval will vary between $1/2$ and $\frac{1/2 + 1/N(k)}{1 + 1/N(k)}$.  So as long as $N(k) \rightarrow \infty$ the limit will exist at $0$.
A: Your idea can be made to work, though it gets a bit messy. If $0<x<1$, there is a unique $n(x)\in\Bbb N$ such that $$\frac1{2^{n(x)+1}}\le x<\frac1{2^{n(x)}}\;.$$ 
For $m\in\Bbb N$ let $I_m=\left[\frac1{2^{m+1}},\frac1{2^m}\right)$, and let $A_m=\{x\in I_m:\lfloor 4^{m+1}x\rfloor\text{ is even}\}$. Let $A^+=\bigcup_{m\ge 0}A_m$; since $2^{n(x)+1}\le 4^{n(x)+1}x<2^{n(x)+2}$ for $x\in(0,1)$, it’s not hard to see that $A_m$ is a finite union of intervals and that $m(A_m)=\frac12m(I_m)$ for each $m\in\Bbb N$ and hence that $m(A^+)=\frac12$.
For $x\in(0,1)$ let $$f(x)=\frac{m\big(A^+\cap(0,x)\big)}x\;.$$
Let $x\in I_m$, and let $k=\lfloor 4^{m+1}x\rfloor$; $2^{m+1}\le k<2^{m+2}$, and $x\in A^+$ iff $k$ is even. Thus, on the interval $$\left[\frac{k}{4^{m+1}},\frac{k+1}{4^{m+1}}\right)$$ the function $f$ is increasing if $k$ is even and decreasing if $k$ is odd.
It’s not hard to check that if $k$ is even, then 
$$\begin{align*}
\frac12&=f\left(\frac{k}{4^{m+1}}\right)\\\\
&<f\left(\frac{k+1}{4^{m+1}}\right)\\\\
&=\frac{\frac{k}{2\cdot4^{m+1}}+\frac1{4^{m+1}}}{\frac{k+1}{4^{m+1}}}\\\\
&=\frac{k+2}{2k+2}\\\\
&=\frac12+\frac1{2k+2}\\\\
&\le\frac12+\frac1{2^{m+2}+2}\;,
\end{align*}$$
while if $k$ is odd, then
$$\begin{align*}
\frac12&=f\left(\frac{k+1}{4^{m+1}}\right)\\\\
&<f\left(\frac{k}{4^{m+1}}\right)\\\\
&=\frac{\frac{k+1}{2\cdot4^{m+1}}}{\frac{k}{4^{m+1}}}\\\\
&=\frac{k+1}{2k}\\\\
&=\frac12+\frac1k\\\\
&<\frac12+\frac1{2^{m+1}}\;.
\end{align*}$$
It follows that $\lim\limits_{x\to 0^+}f(x)=\frac12$ and hence that if $A^-=\{-x:x\in A^+\}$, then the set $A=A^-\cup A^+$ has the desired property.
