Closure of subalgebras of $C(X,\Bbb R)$. I attempted to give a generalization of Stone-Weierstrass Theorem below, but I am not sure if it is correct. If it is not correct, I would like to have a counterexample.

Let $X$ be a compact Hausdorff space and $A$ a subalgebra of $C(X,\Bbb R)$. Define $\mathop{Fix}(A)=\{x\in X:f(x)=0 \text{ for all }f\in A\}$ and $F_A$ to be the function on $\mathop{Fix}(A)$ taking the fixed values. Then $$\overline{A}=\{f\in C(X,\Bbb R): f|_{\mathop{Fix}(A)}\in\left<F_A\right>\}$$ where $\left<F_A\right>$ is the set of all functions of the form $r_nF_A^n+...+r_1F_A$.

In the special case when $\mathop{Fix}(A)$ is empty, $\overline{A}=C(X,\Bbb R)$ and when there exists a point $x_0$ such that $f(x_0)=0$ for all $x_0$ by the above result again $\overline{A}=V(x_0)$ so indeed this gives a generalization.

The statement is incorrect, look at for example $X=[0,1]$ and $A$ the constant functions. Then $Fix(A)=\emptyset$ (hence $f\lvert_{Fix(A)}$ will satisfy any condition) but $A$ is a closed sub-algebra of $C(X)$.
There are some Stone-Weierstraß versions that are similar:

*

*Let $A$ be a sub-algebra of $C(X,\Bbb R)$, if $A$ separates the points outside of $Fix(A)$ then $\overline A = \{ f \in C(X,\Bbb R) \mid f\lvert _{Fix(A)}=0\}$ (which is isomorphic to $C_0(X-Fix(A), \Bbb R)$.)

*For $f: X\to \Bbb R$ let $L(f)=\{ (x,y)\in X\times X \mid f(x)=f(y)\}$. Then $L(A) := \bigcap_{f\in A} L(f)$ defines an equivalence relation $\sim$ on $X$ and
$$\overline A= \{ f\in C(X,\Bbb R)\mid f(x)=f(y)\text{ if $x\sim y$
    and }f\lvert_{Fix(A)}=0\} $$
(this is isomorphic to $C_0((X -
    Fix(A))/\sim,\Bbb R)$.)

