TITLE: $C([a,b])$ is separable
QUESTION [6 upvotes]: We will show that $\mathbb{Q}[x]$ is dense in $C([a,b]).$ This follows from the Weierstrass Approximation Theorem, since given any $f \in C([a,b])$, there exists a sequence of polynomials $$\{p_n\}_{n \in \mathbb{N}} \xrightarrow{u} f.$$ Now, label the real coefficients of $p_n$ as $\{a_0,a_1, \ldots a_n\}.$ Take sequences of rationals $\{q_{i_k} \}_{k \in \mathbb{N}} \to a_i$ with $q_{i_k} \leq a_i$. Let $r_{n,k} \in \mathbb{Q}[x]$ be the polynomial with these coefficents. Clearly then $$\{r_{n,k}\}_{k \in \mathbb{N}} \xrightarrow{u} p_n$$ for each $p_n$ since given $\epsilon >0$ and $K \in \mathbb{N}$ large enough, $$||r_{n,K} - p_n||_{C([a,b])} \leq \epsilon \sum_{i=1}^{n}|x_0^i|$$ for some $x_0 \in [a,b]$ since $r_{n,K} - p_n$ is continuous on the compact set $[a,b]$ at attains a maximum at, say, $x_0$. This $x_0$ works for all $k \geq K$ since the rationals converge to $a_i$ from the left.   This then implies that $$\lim_{n \to \infty} \lim_{ k \to \infty} p_{n,k}  = f,$$ i.e. 
$$\{r_{n,k}\}_{n \in \mathbb{N}, \, k \in \mathbb{N}} \xrightarrow{u} f$$ implying $C([a,b])$ is separable.   
Now my question concerns the bit about the $x_0$. Is it fair to say that this $x_0$ is the same for all polynomials if the rationals converge on the left or right (the point being from one side only so that the signs never change)? Is this even necessary? Any other details I need add?

REPLY [2 votes]: The $x_0$ will depend on $n$ and $K$. But it does not matter, since $|x_0|\le\max(|a|,|b|)$, which is independent of $n$.