I have seen a theorem some time ago, and I don't remember the exact assumptions, so there may be some mistakes. The statement is the following:
If $X$ is an affine variety over an algebraically closed field $k$, then there exists a bijection between $X$ and $\hom(k[X],k)$.
I would like to prove this theorem. What I did so far is to associate for each $x\in X$ the function $\phi_x\in\hom(k[X],k)$, defined by $\phi_x(f) = f(x)$, for each $f\in K[X]$. This association is clearly injective. However, I am not able to prove surjectivity. How can you show that any morphism $\phi: k[X]\to k$ can be written as an evaluation map on some element $x\in X$?