Maximal ideals of unital commutative $C^*$-algebra? 
Define an ideal of a unital commutative $C^*$-algebra $A$ to be a
  proper subspace $I$ of $A$ such that $xy,yx\in I$ for all $x\in I$ and
  $y\in A$. Show that if $\lambda\in \widehat{A}$ (the space of all
  characters, a character is a unital $C^*$-algebra homomorphism from
  $A$ to $\mathbb{C}$), then the kernel $\lambda^{-1}(0)$ is a maximal
  ideal of $A$; conversely, if $I$ is a maximal ideal in $A$, show that
  $I$ is closed, and there is exactly one $\lambda\in \widehat{A}$ such
  that $I=\lambda^{-1}(A)$.

Let $\lambda\in\widehat{A}$ be a character, $\lambda^{-1}(0)$ is a proper subspace can be checked directly (note that $\lambda(1)=1)$), and it is also closed under the multiplication of $A$, thus an ideal of $A$. To show it is a maximal, it suffices to show that the ideal generated by $\lambda^{-1}(0)$ and $x\notin \lambda^{-1}(0)$ is $A$. Since an ideal is closed under scalar multiplicatoin, we may assume that  $\lambda(x)=1$. Let $y\in A$, if we then take $c=\lambda(y)$, then $\lambda(y-cx)=0$, thus $y-cx\in\lambda^{-1}(0)$, thus $y$ is in the ideal generated by $x$ and $\lambda^{-1}(0)$.
Now assume that $I$ is a maximal ideal, it is easy to show that the closure  $\overline{I}$ of $I$ is also an ideal. Since $I$ does not intersect $A^\times$ (the space of all invertible elements of $A$) and $A^\times$ is open, $\overline{I}$ still does not intersect $A^\times$, but $I$ is maximal, thus $I=\overline{I}$, which implies that $I$ is closed.  I am stuck here, I don't know how to construct a character $\lambda$ such that $I=\lambda^{-1}(0)$?
 A: Let $I$ be a maximal ideal of $A$. As you noted $I$ is closed, as such $A/I$ is a Banach algebra. Since $A$ is commutative so is $A/I$.
Since $I$ is a maximal ideal, there are no non-trivial ideals of $A/I$: If $J$ is an ideal of $A/I$, then with $\pi: A \to A/I$, $\pi^{-1}(J)$ is an ideal, since $\pi(x\cdot\pi^{-1}(J))= \pi(x) \cdot J \subset J$. Because $\pi^{-1}(0)=I \subset \pi^{-1}(J)$, either $\pi^{-1}(J)=I$ and $J=0$ or $\pi^{-1}(J)=A$ and $J=A/I$.
Since there are no non-trivial ideals of $A/I$, every nonzero element of $A/I$ is invertible: if $x \in A/I$ then $x \cdot A/I$ is an ideal ($1 \in A/I$), either it is $0$ and then $x=0$ or it is $A/I$ and $1 \in x \cdot A/I$ and $x$ is invertible.
Suppose $x \neq c \mathbb{1}$ for any $c \in \mathbb C$, then $x- c\mathbb 1$ is invertible for all $c$ (as all elements of $A/I$ that are not zero are invertible) and the spectrum of $x$ is empty. But the spectrum on a Banach algebra can never be empty. So $A/I$ has to be isomorphic to $\mathbb{C}$.
Now take $\tilde\lambda: A/I \to \mathbb{C}$ the only unital morphism, $\tilde\lambda$ extends to $\lambda: A \to \mathbb C$ with $\lambda(I)=0$. For every $x \notin I$, $x=c\mathbb 1+i$ with $i \in I$. The extension necessitates $\lambda(c \mathbb 1 + i) = c$ and $\lambda^{-1}(0)=I$.
$\lambda$ is an algebra morphism but we need it to be a $*$-morphism. For it to be a $*$-morphism note that if $I^*=I$, $\lambda(x^*)=\lambda(\bar c \mathbb 1 + i^*)=\bar c = \overline{\lambda(x)}$, so self-adjointness of $I$ implies this property. Every closed 2-sided ideal in a $C^*$-Algebra is self-adjoint though, and since we are in an abelian Algebra every ideal is 2-sided.
To see this: Let $i \in I$, $E_\alpha$ an approximate identity on $I$. Then $0=\lim_\alpha ||E_\alpha i - i||$. Note that $(E_\alpha i - i)^* = (i^* E_\alpha -i^*)$ and so $||E_\alpha i - i|| = ||i^* E_\alpha - i^*||$. Since $I$ is two sided $i^* E_\alpha \in I$ and since $I$ is closed from $\lim_\alpha ||i^* E_\alpha - i^*|| = 0$ you get $i^* \in I$.
