Construct a measurable set $E\subset \Bbb R$ containing $0$ such that
$$\limsup_{h\to 0^+} \frac{1}{2h} m(E\cap [-h,h]) = \alpha$$ for some $\alpha \in (0, \frac 12)$ where $m$ denotes the Lebesgue measure on $\Bbb R$.
Hint: Consider $E:= \{0\} \cup \bigcup_{j=1}^\infty [2^{-j}, 2^{-j} \beta]$ for some appropriate $\beta \in (1,2)$.
I understand that this might possibly be a duplicate, but I'd like feedback on my work below, and other suggestions for constructing the required set $E$.
Let $E:= \{0\} \cup \bigcup_{j=1}^\infty [2^{-j}, 2^{-j} \beta]$ for some $1 < \beta < 2$ (to be determined later.) Let $0 < h < \frac12$. Then, there exists $k \in \mathbb N$, $k \ge 1$ such that $2^{-k-1} \le h < 2^{-k}$. Note that $k \to \infty$ as $h\to 0$. We have $$\frac{1}{2h} m(E\cap [-h,h]) = \frac{1}{2h} m(E\cap [0,h]) = \frac{\beta - 1}{2h}\sum_{j\ge k+1} 2^{-j} = \frac{\beta - 1}{2h} \cdot 2^{-k} = \frac{2^{-k-1}(\beta - 1)}{h}$$ Since $2^{-k-1} \le h < 2^{-k}$, we have the bounds $$\frac{\beta-1}{2} < \frac{1}{2h} m(E\cap [-h,h]) \le \beta - 1$$ giving $$\frac{\beta-1}{2} < \limsup_{h\to 0^+}\frac{1}{2h} m(E\cap [-h,h]) \le \beta - 1$$ We show that $\limsup_{h\to 0^+}\frac{1}{2h} m(E\cap [-h,h]) = \beta - 1$. For any $0 < \epsilon < \frac 1 2$, we can find $k \in \mathbb N$ such that $2^{-k} < \epsilon$. Then, let $h \in [2^{-k-1}, 2^{-k})$. If $h = 2^{-k-1}$, then $$\frac{1}{2h} m(E\cap [-h,h]) = \frac{2^{-k-1}(\beta - 1)}{h} = \beta - 1$$ As $\epsilon \in (0, \frac{1}{2})$ is arbitrary, we have $$\limsup_{h\to 0^+}\frac{1}{2h} m(E\cap [-h,h]) = \lim_{\epsilon \to 0} \sup\left\{\frac{1}{2h} m(E\cap [-h,h]): h \in (0,\epsilon)\right\} = \beta - 1$$ Finally, choosing $\beta = 1 + \alpha$ gives the desired equality.
I'd like to know if my work is correct, and suggestions for alternative constructions of the set $E$ (i.e., different from the hint.) Thank you!