Zero set of ideal of an algebraic set is the algebraic set itself An algebraic set defined by $S \subseteq k[x_1,...,x_n]$ is given by
$$X = \{a \in \mathbb{A}^n(k) | f(a) = 0, \forall f\in S\}$$
So this would the set of points that make polynomials in $S$ vanish.
The ideal of a set $X \subset \mathbb{A}^n(k)$ is given by:
$$I(X) = \{ f \in k[x_1,...,x_n] | f(a) = 0, \forall a \in X \}$$
So this is the set of polynomials that vanish on points in $X$.
Lastly, the zero set of $I(X)$ is given by:
$$V(I(X)) = \{a \in \mathbb{A}^n(k) | f(a) = 0, \forall f \in I(X)\}$$
which is the set of points that make polynomials in $I(X)$ vanish.
Now I am trying to prove that if $X$ is an algebraic set then $V(I(X)) = X$, which is an exercise that I have taken from a book I'm reading ("Algbraic Geometry: A Problem Solving Approach"). My intuition tells me that this would be the case if I could prove that $S = I(X)$. I can see that $S \subseteq I(X)$ since if a polynomial $f$ is in $S$ then of course we have that $f(a) = 0, \forall a \in X$. Then it would naturally follow that $X = V(S) = V(I(X))$, however I am struggling to see why $I(X) \subseteq S$ since $I(X)$ might contain a polynomial $g$ s.t. $g(a) = 0$ but $g \notin S$.
 A: Note that for every ideal $J\subseteq k[x_1,...,x_n]$ we have $J\subseteq I(V(J))$, and for every subset $X\subseteq \mathbb{A^n}$ we have $X\subseteq V(I(X))$. This is obvious from the definitions.
Now, suppose $J\subseteq k[x_1,...,x_n]$ is an ideal. We'll prove that $V(J)=V(I(V(J)))$. First of all, we already know that $J\subseteq I(V(J))$, and hence $V(I(V(J)))\subseteq V(J)$, as taking $V$ inverts the order. For the reverse inclusion, let $X=V(J)$. Then:
$V(J)=X\subseteq V(I(X))=V(I(V(J)))$
So indeed we have $V(J)=V(I(V(J)))$, for every ideal $J\subseteq k[x_1,...,x_n]$.
Finally, in your case we have $X=V(S)=V(J)$ where $J$ is the ideal generated by $S$. Thus:
$X=V(J)=V(I(V(J)))=V(I(X))$
A: Observe that $V$ and $I$ are inclusion reversing: (a) if $X\subseteq X'\subseteq \mathbb{A}^n(k)$, then $I(X')\subseteq I(X)$, and (b) if $Y\subseteq Y'\subseteq k[x_1,\dots,x_n]$, then $V(Y')\subseteq V(Y)$.
Next, observe that (c) for $X\subseteq \mathbb{A}^n(k)$ and $Y\subseteq k[x_1,\dots,x_n]$, we have $X\subseteq V(Y)$ if and only if $Y\subseteq I(X)$, since both hold if and only if every  polynomial in $Y$ vanishes on every point in $X$.
This gives the structure of a Galois connection, and your desired result follows purely formally.
Since $I(X)\subseteq I(X)$, by (c), $X\subseteq V(I(X))$. For the other inclusion: since $X$ is an algebraic set, $X = V(Y)$ for some $Y\subseteq k[x_1,\dots,x_n]$. Now $X\subseteq X = V(Y)$, so by (c), $Y\subseteq I(X)$, and by (b), $V(I(X)) \subseteq V(Y) = X$.
The same argument (reversing the roles of $X$ and $Y$ and using (a) instead of (b) in the last step) shows that for $Y\subseteq k[x_1,\dots,x_n]$, if $Y = V(X)$ for some $X\subseteq \mathbb{A}^n(k)$, then $I(V(Y))= Y$. If $k$ is algebraically closed, then the ideals which are "closed" in this sense (i.e. which arise as $V(X)$ for some $X\subseteq \mathbb{A}^n(k)$) are exactly the radical ideals, by Hilbert's Nullstellensatz.
