Exercise 1.27 (Stein & Shakarchi): Suppose $E_1$ and $E_2$ are a pair of compact sets in $\mathbb{R}^d$ with $E_1 \subset E_2$ and let $a = m(E_1)$ and $b = m(E_2)$. Prove that for any $c$ with $a < c < b$, there is a compact set $E$ with $E_1 \subset E \subset E_2$ and $m(E) = c$.
Hint: As an example, if $d = 1$ and $E$ is a measurable subset of $[0, 1]$, consider $m(E ∩ [0, t])$ as a function of t.
Here is my intuition for tackling this exercise
Consider a countable sequence of closed cubes centered at the origin which increase in measure (essentially I imagine that the cubes fill $\mathbb{R}^d$ as they grow infinitesimally in terms of side length). Now, as the cubes grow we should be able to create a measurable set $E$ such that $E_1 \subset E \subset E_2$ where $m(E) = c$ and $a < c< b$, by taking the intersection of some limit of these closed cubes with $E_2$. Now, it's clear by construction that this set would be compact, as a closed subsets of a compact set are themselves compact.
However, I am having trouble justifying that this $E$ does exist. I'm thinking that it should because $E_1 \subset E_2$ with measures $m(E_1) = a$ and $m(E_2) = b$ remind me of $[a,b]$ some connected interval in $\mathbb{R}$. Thus, with the hint in mind, we should be able to create a continuous function and use the Intermediate Value Theorem.
With all this in mind, I'm having trouble formalizing this intuition, it's that classic tip of the tongue feeling! Any hints or correction of my intuition would be most welcome!
Let $E_1, E_2$ be two compact sets in $\mathbb R^d$. Let $f : \mathbb R \to \mathbb R$ be defined by
$$ f(t) = m(E_1 \cup (E_2 \cap \{ x_1+ \cdots + x_d \le t\})),$$ where $x_1, \cdots, x_d$ are the standard coordinates of $\mathbb R^d$. Then it is easy to see that $$ \lim_{t\to -\infty} f(t) = m(E_1), \ \ \lim_{t\to +\infty} f(t) = m(E_2).$$
Also, for any $t>s$,
$$ f(t) - f(s) \le m (E_2 \cap \{s \le x_1+ \cdots + x_d \le t\})) \le C(t-s)$$
for some $C$ depending on $n, E_2$. Thus $f$ is continuous and so your result follows from the intermediate value theorem: for any $ c$ so that $m(E_1)< c<m(E_2)$, there is $t\in \mathbb R$ so that $f(t) = c$. Let $$ E = E_1 \cup ((E_2 \cap \{s \le x_1+ \cdots + x_d \le t\}).$$ Then $E$ is compact, $E_1 \subset E\subset E_2$ which has $m(E)=f(t) = c$.