This (for real-valued rather than complex-valued functions) was in [Stone's original paper](http://www.ams.org/journals/tran/1937-041-03/S0002-9947-1937-1501905-7/home.html) that proved the Stone-Weierstrass theorem, as Theorem 84. The statement is a bit funny, since he defines the equivalence relation $x\sim y$ not in the obvious way but as "$x$ is in the intersection of all sets $f^{-1}(U)$ such that $f\in\mathcal{A}$, $U\subset\mathbb{R}$ is an open interval, and $y\in f^{-1}(U)$" (this definition appears in the statement of Theorem 81).