Solution 1:

Whoever told you that was mistaken; there is no way to prove this without using some special property of $[0,1]$ that is closely related to compactness. To try to convince you of this, let me point out that the result is not true if you replace $[0,1]$ by $(0,1]$. Indeed, if $R$ is the ring of continuous functions $(0,1]\to\mathbb{R}$, let $I\subset R$ be the set of functions which are identically $0$ on $(0,\epsilon)$ for some $\epsilon>0$. Then $I$ is an ideal: if $f,g\in I$ with $f$ vanishing on $(0,\epsilon)$ and $g$ vanishing on $(0,\epsilon')$, then $f+g$ vanishes on $(0,\min(\epsilon, \epsilon'))$. And if $f\in I$ and $g\in R$, then $gf$ vanishes everywhere that $f$ does, so $gf\in I$.

Since the constant function $1$ is not in $I$, $I$ is a proper ideal in $R$, so there is some maximal ideal $M$ containing it. But for any $c\in (0,1]$, $M\neq M_c$, since we can take $\epsilon=c/2$ and find a continuous function $f$ which vanishes on $(0,\epsilon)$ but such that $f(c)\neq 0$, and then $f\in M$ but $f\not\in M_c$.

More generally, a similar counterexample can be given for any reasonably nice non-compact space. To be precise, let $X$ be any completely regular space that is not compact and let $R$ be the ring of continuous functions $X\to\mathbb{R}$. Then there exists a maximal ideal in $R$ which is not $M_c=\{f\in R:f(c)=0\}$ for any $c\in X$. (Proof sketch: pick a point $x\in \beta X\setminus X$, let $I$ be the ideal of functions which vanish in a neighborhood of $x$, and let $M$ be any maximal ideal containing $I$.)

Solution 2:

Maximal ideals in the ring of continuous functions were studied by Edwin Hewitt in

Hewitt, Edwin. Rings of real-valued continuous functions. I. Trans. Amer. Math. Soc. 64, (1948). 45–99.

He called such ideals hyper-real. They are not always principal :-)