Is Hausdorffness necessary condition for the Stone-Weierstrass theorem? Following Rudin's argument, I cannot find where it used Hausdorffness condition.

=======

Rudin PMA p.162

Let $X$ be a compact space.
Let $\mathscr{A}$ be a subalgebra of $C(X,\mathbb{R})$.
If $\mathscr{A}$ separates points and vanishes nowhere, then $\mathscr{A}$ is dense in $C(X,\mathbb{R})$ with respect to the uniform topology.

======

The proof is divided into four steps.


$\forall f\in \overline{\mathscr{A}}, |f|\in \overline{\mathscr{A}}$
$\forall f,g\in \overline{\mathscr{A}}, \max(f,g),\min(f,g)\in \overline{\mathscr{A}}$.
$\forall ( f\in C(X,\mathbb{R}),x\in X, \epsilon &gt;0), \exists g\in \overline{\mathscr{A}}$ such that $g(x)=f(x)\bigwedge g(x)&gt;f(x)-\epsilon$.
$\forall ( f\in C(X,\mathbb{R}), \epsilon&gt;0), \exists h\in \overline{\mathscr{A}}$ such that $||h-f||_\infty &lt;\epsilon$.


I believe Steps 1&amp;2 use only uniform continuity and classical Weierstrass theorem and Steps 3&amp;4 only use compactness.

Where did I go wrong?
Where in the argument use the Hausdorff condition?
Wikipedia's statement of the theorem is


  Suppose $X$ is a compact Hausdorff space and $A$ is a subalgebra of $C(X,\mathbb R)$ which contains a non-zero constant function. Then $A$ is dense in $C(X,\mathbb R)$ if and only if it separates points.


(Emphasis added.)

What you've quoted from Rudin asserts only the "if" direction (separating points implies dense); for that statement, we can omit the assumption that $X$ is Hausdorff because (as noted by others here already) the assumption that $A$ separates points already implies that $X$ is Hausdorff.  (If, as suggested in comments, it is thought misleading to omit this condition — as Rudin does — I would strongly prefer merely to add a remark to the effect that the hypothesis implies Hausdorffness, not to add redundant hypotheses, which only make theorems harder to use.)

However, for the "only if" direction (dense implies separating points) the assumption that $X$ is Hausdorff cannot be dropped.  (Example: if $X$ has at least two points and the trivial topology, i.e., only $\emptyset$ and $X$ are open, then $C(X,\mathbb R)$ is a dense subalgebra of itself but doesn't separate points.)  I can't think of a use for this direction off the top of my head; I suspect it's much less important than the other direction.
In fact, if a topology is not Hausdorff, it makes no means. We can always assume that any topology is Hausdorff except in pure theory of topology.