Is $L^2(D)$ separable? Let $D$ be a bounded connected open subset of $R^n$ and $μ$ is a finite measure on $D$, say the Lebesgue measure. Is $L_2(μ)$ separable? Is a bounded sequence $\{f_k\}$ of $L^2(μ)$ pre-compact?
 A: *

*Consider a sequence $\{x_n\}$ dense in $D$, then the collection $\mathcal C=\{B(x_n,m^{-1}),n\in\Bbb N, m\geq 1\}$ is countable and generated the Borel $\sigma$-algebra. Denote $\mathcal A$ the algebra generated by $\mathcal C$, which is also countable.

*Let $\mathcal B:=\{A\subset D\mid \forall \varepsilon>0, \exists A'\in\mathcal A,\mu(A\Delta A')\leq\varepsilon\}$. We can show that $\mathcal B$ is a $\sigma$-algebra which contains $\mathcal A$, so it contains the Borel $\sigma$-algebra over $D$. 

*Let $\mathcal D:=\{f\colon x\mapsto \sum_{j=1}^Nr_j\chi_{A_j}, N\in\Bbb N, r_j\in\Bbb Q, B_j\in\mathcal B\}$, then $\mathcal D$ is countable. 

*Now we show that $\mathcal D$ is dense in $L^2(\mu)$. Let $f\in L^2(\mu)$ and $\varepsilon>0$. We can write $f=\max(f,0)-\min(f,0)$ so we just have to show that is $f$ is in $L^2(\mu)$ and non-negative then we can find $g\in\mathcal D$ such that $\lVert f-g\rVert_{L^2}\leq \varepsilon$. We assume $f\geq 0$, then by definition of Lebesgue integral, we can find an integer $N$, $a_j\in\mathbb R$ and $A_j$ Borel sets such that $\lVert f-\sum_{j=1}^Na_j\chi_{A_j}\rVert_{L^2}\leq \frac{\varepsilon}3$. For each $N$, pick $r_j$ a rational number such that $\lvert a_j-r_j\rvert\leq \frac{\varepsilon}{3N\mu(D)}$, then 
$$\lVert \sum_{j=1}^Na_j\chi_{A_j}-\sum_{j=1}^Nr_j\chi_{A_j}\rVert_{L^2}\leq 
\sum_{j=1}^N|a_j-r_j|\lVert \chi_{a_j}\rVert_{L^2}\leq \frac{\varepsilon}{3N\mu(D)}N\max_{1\leq j\leq N}\mu(A_j)=\frac{\varepsilon}3.$$

*Now, we pick $B_j\in\mathcal A$ such that $\mu(A_j\Delta B_j)\leq \frac{\varepsilon}{3N(1+|r_j|)}$, and we are done. 



If a sequence $\{f_n\}$ is pre-compact, then it has to be bounded and equi-integrable. There is also a condition about translated of $f_n$ (i.e. maps of the form $f_n(x+h), h\in\mathbb R$, namely $\lim_{h\to 0}\sup_{n\in\Bbb N}\lVert f_n(\cdot+h)-f_n(\cdot)\rVert_{L^2}=0$, and these conditions are necessary and sufficient to have pre-compactness. 
A: By standard measure theory (Lusin's theorem, for instance), the continuous functions $C(D)$ are dense in $L^2(D)$. By Stone-Weierstrass, the polynomials are dense in $C(D)$ (uniformly, and so in $L^2$). And, finally, the polynomials with rational coefficients are dense in the polynomials. This last set is countable and dense in $L^2(D)$. 
Regarding your second question, the fact that  the Lebesgue measure of $D$ is nonzero guarantees that $L^2(D)$ is infinite-dimensional, and as such it has a countable orthonormal basis $\{e_j\}_{j\in\mathbb{N}}$ (we know it is countable by the first part of the question, although it is irrelevant here). The distance between any two elements in this basis is $\sqrt2$, so if we consider the sequence of balls of radius $\sqrt2/2$ around each $e_j$, we get an open cover of the sequence with no finite subcover.
