Let $M_p$ be the ideal of those continuous functions of $C[0,1]$ which have $p\in [0,1]$ as a zero. It is a commonly known fact that $M_p$ is a maximal ideal. However, the proof is generally non-trivial. I was wondering if the proof I am about to present is accurate. I feel it is much simpler than the one books generally prescribe, and hence there must be something wrong in it.
Let $f(x)\notin M_p$. Hence $f(p)=c$, where $c\neq 0$. Clearly, the continuous function $g(x)=(f(x)-c)\in M_p$. Now $f(x)-g(x)=c\in (M_p,f(x))$, which is a unit. Hence, $(M_p,f(x))=R$
Is the proof correct?
The proof books generally give: Let $f(x)\notin M_p$. Then for any $g(x)\in M_p$, where the only zero of $g(x) \in [0,1]$ is $p$, $f^2+g^2\notin M_p$, and also a unit. Hence, $(M_p,f(x))=R$. I have seen this proof in multiple books.
The proof is trivial. If $X$ is any space, $p \in X$ and $C(X)$ is the ring of (say) $\mathbb{C}$-valued continuous functions on $X$, then $C(X) \to \mathbb{C}$, $f \mapsto f(p)$ is a ring homomorphism (clear) which is surjective (consider constant functions) and the kernel is (by definition) $M_p$. Hence $C(X)/M_p \cong \mathbb{C}$ is a field, i.e. $M_p$ is maximal.
(The mentioned proof in freebird's question just repeats the characterization of maximal ideals by quotient rings.)