I thought it was obvious, but I do not manage to prove it. So, I wonder whether it is true actually. Let $X$ be a compact of $\mathbb R$, $\mathcal A$ be a $\mathbb R$-subalgebra dense of $\mathscr C(X,\mathbb R)$ (the $\mathbb R$-algebra of continuous functions on $X$). Then, for all $x,y\in X$ with $x\ne y$, there exists $f\in\mathcal A$ such that $f(x)=0$ and $f(y)=1$.
Can anyone disprove or prove this fact? Thanks in advance.
I won't assume subalgebras are unital. In $\mathscr{C}(X,\Bbb R)$ there are functions $f_1$ and $f_2$ with $f_1(x)=0$, $f_1(y)=1$, $f_2(x)=1$ and $f_2(y)=0$. In your dense $\mathscr{A}$ there are $g_1$ and $g_2$ which are $\varepsilon$-close to $f_1$ and $f_2$, and we can choose $\varepsilon$ to ensure that the vectors $(g_1(x),g_1(y))$ and $(g_2(x),g_2(y))$ are linearly independent. Then some $\Bbb R$-linear combination $h$ of $g_1$ and $g_2$ has $h(x)=0$ and $h(y)=1$.