In Hartshone section 1 exercise 1.5, he wants me to prove that
If $B$ if a finitely generated $k$-algebra with no nilpotent elements, then $B$ is isomoprhic to the affine coordinate ring of some algebraic set in $\mathbf{A}^{n}$, for some $n$.
What I know is that if $B$ is a finitely generated $k$-algebra that is also an integral domain, then $B$ is isomorphic to the affine coordinate ring of some affine variety.
Hence, I want to show that
If $B$ is a finitely generated $k$-algebra, then $B$ is an integral domain.
However, I got stuck only several steps away from the start. Suppose that there exists a non-zero zero divisor $b\in B$, so that there exists $x\in B\setminus\{0\}$ such that $bx=0$. As $B$ is finitely generated over $k$, there exists a finite subset $\{b_{0},\cdots, b_{r}\}$ of $B$ such that $b$ and $x$ can be written as $$b=\sum_{j=0}^{r}c_{j}\cdot b_{j}\ \ \text{and}\ \ x=\sum_{i=0}^{r}e_{i}\cdot b_{i},$$ where $c_{j},e_{i}\in k$, and the $\cdot$ is the scalar multipliation $\cdot:k\times B\longrightarrow B$ that comes with the $k$-module structure.
Then, $$bx=\Bigg(\sum_{j=0}^{r}c_{j}\cdot b_{j}\Bigg)\Bigg(\sum_{i=0}^{r}e_{i}\cdot b_{i}\Bigg)=0.$$ Well, then I tried to use the fact that $B$ is a $k$-algebra, so the ring multiplication and the scalar multiplication are compatible.
In other words, let us set $\xi:=\sum_{j=0}^{r}c_{j}\cdot b_{j}\in B$, the the above product is $$\xi(e_{0}\cdot b_{0})+\xi(e_{1}\cdot b_{1})+\cdots +\xi(e_{r}\cdot b_{r}).$$ So, using the compatibility, say to the case of $i=0$, we have \begin{align*} \xi(e_{0}\cdot b_{0})=e_{0}\cdot (\xi b_{0})&=e_{0}\cdot\Bigg(\sum_{j=0}^{r}c_{j}\cdot b_{j}\Bigg)b_{0}\\ &=e_{0}\cdot\Bigg(\sum_{j=0}^{r}(c_{j}\cdot b_{j})b_{0}\Bigg)\\ &=e_{0}\cdot\Bigg(\sum_{j=0}^{r}c_{j}\cdot (b_{j}b_{0})\Bigg) \end{align*}
Hence, the product $bx$ is $$bx=\sum_{i=0}^{r}e_{i}\cdot\Bigg(\sum_{j=0}^{r}c_{j}\cdot (b_{j}b_{i})\Bigg)=0,$$ but I do not see if I can go further toward this direction...
Is what I am trying to show wrong? If so, is there any other way to prove this exercise? Thank you!
Not necessarily. Consider the union of the $x$ and $y$ axes in $\Bbb{A}^2_k$. It is the vanishing locus of $f(x,y)=xy$. The ring $k[x,y]/(xy)$ is not an integral domain because $\overline{x}\cdot \overline{y}=0$. However, being the coordinate ring of this affine algebraic set it is reduced (which is not hard to check directly, as well). However, if you require that your algebraic set is irreducible in addition, you will find that its coordinate ring is an integral domain.