Compact Hausdorff Space - X Second Countable iff C(X) separable I recently stumbled across a property of compact Hausdorff spaces which is supposedly well-known, namely:
If $X$ is a compact Hausdorff space, then $X$ is second countable if and only if $C(X)$ is separable.
Now, I was not able to find a proof of this anywhere that does not rely on showing equivalences to metrizability, and was wondering if there is a more elegant way of showing this fact.
 A: If $C(X)$ is separable,  take a countable dense set $D\subseteq C(X)$.  Then the open sets of the form
$$
  U=f^{-1}(0,1),
  $$
for $f$ in $D$, will form a countable basis for the topology of $X$.
Conversely, if $X$ is second countable,  take a countable basis of open sets $\scr U$ and,  for every pair $(U_1, U_2)$
of open sets in $\scr U$,  such that $\overline U_1 \subseteq  U_2$,  chose an (Urysohn) function
$$
  f=f_{U_1, U_2}:X\to {\mathbb R}
  $$
such that $f\equiv 1$
on $U_1$, and $f\equiv 0$ on $X\setminus U_2$.  Then the rational  subalgebra generated by the
$f_{U_1, U_2}$ is countable and dense in $C(X)$ (by Stone-Weiestrass),  so $C(X)$ is separable.

EDIT:
Upon request, let me prove the first claim above.   Actually
let me instead prove that the sets of the form
$$
  U=f^{-1}(1,+\infty ),
  $$
for $f$ in $D$, form a basis for the topology of $X$.  This would in fact be a better claim in my answer and it also clearly
implies that $X$ is seconnd countable.  If desired,  one may then  easily
use this fact to prove the claim, as it appears above.
Let $V\subseteq X$ be any open set and let $p$ be a point in $V$.  It is then enough to find some $f$ in $D$ such that
$$
  p\in f^{-1}(1, +\infty )\subseteq V.\tag{*}
  $$
In order to do so, use Urysohn to find a continuous function $g:X\to [0,2]$, such that $g(p)=2$, and $g=0$ off $V$.
Since
$D$ is dense in $C(X)$, we may pick some $f$ in $D$ such that $\|g-f\|<1$.
It follows that
$f(p)>1$, so
$p\in f^{-1}(1,+\infty )$.
Also  $|f(x)|≤1$ on $X\setminus V$, so
$$
  X\setminus V\subseteq  f^{-1}(-\infty , 1].
  $$
By taking complements (and reversing the inclusion sign), we get
$$
  f^{-1}(1, \infty )\subseteq V,
  $$
proving (*).
