$M_a=\{f\in C[0,1]~:~f(a)=0\}\ne\langle x-a\rangle$ Consider a ring $C[0,1]$ of real valued continuous functions on $[0,1]$ under pointwise addition and multiplication. Let $0<a<1$ and $M_a=\{f\in C[0,1]~:~f(a)=0\}$. I need to prove that $M_a$ is not equal to the principal ideal generated by $x-a$. 
The principal ideal generated by $x-a$ consists of all polynomials which has $a$ as a root. How do show that this ideal doesn't contain all continuous functions. 
I can also see $M_a$ is an ideal. Will it be principal?
 A: First off, it is an error to assert that "The principal ideal generated by $x - a$ consists of all polynomials . . . "; there are a very large number indeed of non-polynomials in $\langle x - a \rangle$.
This being said:
Consider
$g(x) = \vert x - a \vert; \tag 1$
$g(x)$ is clearly continuous, being the composition of the continuous functions $\vert \cdot \vert$ and $x - a$; thus
$g(x) \in C[0, 1]; \tag 2$
also,
$g(a) = \vert a - a \vert = 0; \tag 3$
thus 
$g(x) \in M_a; \tag 4$
however, I claim that
$g(x) \notin \langle x - a \rangle; \tag 5$
for, if on the contrary, 
$g(x) \in \langle x - a \rangle, \tag 6$
then
$\exists \; h(x) \in C[0, 1], \; \vert x - a \vert = g(x) = (x - a)h(x); \tag 7$
now let $x \in (a, 1]$; then $x > a$, whence $x - a > 0$, whence
$\vert x - a \vert = x - a; \tag 8$
now by (7) we must have
$h(x) = 1, \; x \in (a, 1]; \tag 9$
if $x \in [0, a)$, then $x < a$ and $x - a < 0$, whence
$\vert x - a \vert = -(x - a), \tag{10}$
so
$h(x) = -1, x \in [0, a); \tag{11}$
it is clear now from (9) and (11) that $h(x)$ has no limit as $x \to a$; indeed,
$\displaystyle \lim_{x \to a^-} h(x) = -1, \; \lim_{x \to a^+} h(x) = 1; \tag{12}$
that is $h(x)$ is not continuous at $a$; it follows that there is no $h(x) \in C[0, 1]$ satisfying
$\vert x - a \vert = g(x) = (x - a)h(x); \tag{13}$
therefore
$g(x) \notin \langle x - a \rangle; \tag{14}$
now it follows from (4) and (14)  that
$\langle x - a \rangle \subsetneq M_a; \tag{15}$
$\langle x - a \rangle$ is contained in, but not equal to, $M_a$.
Is $M_a$ a principal ideal in $C[0, 1]$?  A negative answer holds here as well.  For if $M_a$ were principal, we would have
$M_a = \langle k(x) \rangle \tag{16}$
for some $k(x) \in C[0, 1]$.  Then $k(a) = 0$ since $k(x) \in M_a$; there are no other zeroes $x'$ of $k(x)$ in $[0, 1]$, lest every function $f(x) = k(x)h(x) \in M_a$ satisfy $f(x') = f(x) = 0$; this can't be true, as illustrated by function $x -a \in M_a$; so $k(x)$ has one zero, $a$, in $[0, 1]$.  Now either $k(x)$ changes sign at $a$, or it doesn't; suppose first that it does; since $a$ is the only zero of $k(x)$, we may assume without loss of generality, since we may if necessary replace $k(x)$ with $-k(x)$, that $k(x) > 0$ for $x \in (a, 1]$ and $k(x) < 0$ on $[0, a)$; then as in the argument above we consider the continuous function $\vert k(x) \vert \in M_a = \langle k(x) \rangle$; we then have $\vert k(x) \vert = k(x)h(x)$ for some $h(x) \in C[0, 1]$; but now we see, as we did above with $\vert x - a \vert$ etc., that $h(x) = 1$ on $(a, 1]$ and $h(x) = -1$ on $[0, a)$; but then taking limits as $x \to a^\pm$, we see that $h(x)$ cannot be continuous at $a$; now if $k(x)$ does not change sign at $a$, we can again without loss of generality assume $k(x) > 0$ for $x \ne a$; if we replace  $k(x)$ on $[0, a]$ by $-k(x)$, we obtain a new function $k'(x)$ which agrees with $k(x)$ for $x \ge a$, but is $-k(x)$ for $x \le a$; furthermore, since $k(a) = 0$, $k'(x)$ is continuous; since $k'(a) = 0$, $k'(x) \in M_a$; thus we must have $k'(x) = k(x)h(x)$ for some $h(x) \in C[0, 1]$; but now the method exploited in the case of $x - a$ shows that $h(x)$ cannot be continuous at $a$; we conclude then that $h(x)$ cannot be continuous whether $k(x)$ changes sign at $a$ or not; thus there is no $h(x) \in C[0, 1]$ such that $\vert k(x) \vert =  k(x)h(x)$ or $k'(x) = k(x)h(x)$; thus $M_a$ cannot be a principal ideal in $C[0, 1]$.
