Another fun qualifying exam practice question!
Suppose $E$ is a given set and $O_n$ is the open set defined as $O_n = \left\{x: \operatorname{dist}(x,E) < \frac1n\right\}$
a) Show that if $E$ is compact then $m(E) = \lim_{n \to \infty} m(O_n)$
What I have so far: Define $B_k = \bigcap^k_{i=0}O_n = O_k$
Then $B_{k+1} \subseteq B_k$
Also $\lim_{n \rightarrow \infty}B_k = \bigcap^\infty_{i=0}O_n = E$ (Since $E$ is closed and bounded? I'm not really sure why this is true!)
So $B_k$ converges downward to $E$. Since measures are monotone, $m(B_k)$ converges downward to $m(E)$
So $\lim_{k \rightarrow \infty}m(B_k) =\lim_{k \rightarrow \infty}m(\bigcap^k_{n=1}O_n) =\lim_{k \rightarrow \infty}m(O_k)=m(E)$
Basically I'm wondering how compactness plays into this argument.
b) Show that the conclusion may be false for $E$ closed and unbounded or open and bounded.
Since I'm not sure how compactness plays into the above argument I'm having a hard time coming up with a counter example.
If $x\in\bigcap_{n=1}^{\infty}O_n$ then $d(x,E)<\frac1n$ for every positive integer $n$ and this can only be true iff $d(x,E)=0$ or equivalently $x\in\overline E$.
$E$ is compact hence closed so that $E=\overline E$, so we have $E=\bigcap_{n=1}^{\infty}O_n$.
Actually here we only need that $E$ is closed, but the condition of boundedness comes in to ensure that $m(O_n)<\infty$ for some $n$.
Under that extra condition your solution works.
If we would e.g. take $E=\mathbb R\times\{0\}\subseteq\mathbb R^2$ then $m(O_n)=\infty$ for every $n$.