How to prove a variety is not closed (in a certain larger one)? Here is the problem:

Show by example that the subgroup of an algebraic group generated by two non-irreducible closed subsets need not be closed.

and a hint is given:

Use the cyclic subgroups of $GL(2, \mathbb{C})$ generated by $\begin{pmatrix}
 1 & 0 \\ 
 0 & -1 
\end{pmatrix}$ and $\begin{pmatrix}
 1 & 1 \\ 
 0 & -1 
\end{pmatrix}$.

Now, let $G_1 = \{ \begin{pmatrix}
 1 & 0 \\ 
 0 & 1 
\end{pmatrix}, \begin{pmatrix}
 1 & 0 \\ 
 0 & -1 
\end{pmatrix} \} $ and $G_2 = \{ \begin{pmatrix}
 1 & 0 \\ 
 0 & 1 
\end{pmatrix}, \begin{pmatrix}
 1 & 1 \\ 
 0 & -1 
\end{pmatrix} \}$ (the cyclic subgroups generated by $\begin{pmatrix}
 1 & 0 \\ 
 0 & -1 
\end{pmatrix}$ and $\begin{pmatrix}
 1 & 1 \\ 
 0 & -1 
\end{pmatrix}$
). Both are closed and non-irreducible subsets (subgroups). The subgroup generated by $G_1$ and $G_2$ is $G = \{ \begin{pmatrix}
 1 & n_1 \\ 
 0 & 1 
\end{pmatrix}, \begin{pmatrix}
 1 & n_2 \\ 
 0 & -1 
\end{pmatrix} : n_1, n_2 \in \mathbb{Z} \} $. As $G$ is a set of discrete points in $GL(2, \mathbb{C} )$, can it be not closed? 
In another way, set $G_1 = \{ \begin{pmatrix}
 a & 0 \\ 
 0 & a 
\end{pmatrix}, \begin{pmatrix}
 b & 0 \\ 
 0 & -b 
\end{pmatrix} : a,b \in \mathbb{C}^* \} $ and $G_2 = \{ \begin{pmatrix}
 a & 0 \\ 
 0 & a 
\end{pmatrix}, \begin{pmatrix}
 b & b \\ 
 0 & -b 
\end{pmatrix} : a,b \in \mathbb{C}^* \}$. They are closed and non-irreducible. And the subgroup of $GL(2, \mathbb{C})$ generated by $G_1$ and $G_2$ is $G= \{ \begin{pmatrix}
 a & 0 \\ 
 0 & a 
\end{pmatrix}, \begin{pmatrix}
 b & 0 \\ 
 0 & -b 
\end{pmatrix}, \begin{pmatrix}
 c & c \\ 
 0 & -c 
\end{pmatrix}, \begin{pmatrix}
 d & d \\ 
 0 & d 
\end{pmatrix} : a,b,c,d \in \mathbb{C}^* \} $. Isn't it closed? And why?
I don't know if I am wrong somewhere.
To prove a variety is closed, we often make the target variety into the inverse image of a closed variety. 
But how to prove a variety is not closed (in a certain larger one)?
Many thanks.
 A: Assuming that you are supposed to use Zariski topology, then let's consider the ideal $I(G)$ of polynomials in $R=\mathbf{C}[x_{11},x_{12},x_{21},x_{22}]$ that vanish at all points of $G$. Clearly $x_{11}-1,x_{21},x_{22}^2-1\in I(G)$. Let $J$ be the ideal generated by these three polynomials. We shall prove that actually $J=I(G)$. As the generators of $J$ belong to $I(G)$, clearly $J\subseteq I(G)$. The reverse inclusion
requires a little bit of work.
Let $q$ be an arbitrary polynomial in $I(G)$. The argument is based on the observation that
we can write $q$ in the form $q=p+j$, where $j\in J$, and the other polynomial is of the form $p=f(x_{12})+x_{22}g(x_{12})$, with $f,g\in\mathbf{C}[x_{12}]$. This follows from the facts that 


*

*For all positive integers $k$ the power $x_{11}^k\equiv 1\pmod J$, because the polynomial $x_{11}-1\in J$,

*Any multiple of $x_{21}$ is in $J$, because $x_{21}\in J$,

*For all positive integers $k$ the power $x_{22}^{k+2}\equiv x_{22}^k\pmod J$, because
the polynomial $x_{22}^2-1\in J$. Applying this recursively we can replace a term with a high power of $x_{22}$ with another one, where the exponent is either zero or one. All this by moving within a single coset of $J$.


We have
$$
p\left(\begin{array}{cc}1&n\\0&1\end{array}\right)=f(n)+g(n),
$$
and
$$
p\left(\begin{array}{cr}1&n\\0&-1\end{array}\right)=f(n)-g(n).
$$
In order for both of these to vanish simultaneously we must have $f(n)=g(n)=0$. This
must happen for all $n\in\mathbf{Z}$. This is possible if and only if $f=g=0$, because a non-zero polynomial has only finitely many zeros in $\mathbf{C}$. Therefore we must actually have $p=0$, so $q\in J$, and $I(G)=J$. 
Thus the Zariski closure of $G$ consists of the zero set of polynomials in $J$, but this set 
$$
V(I(G))=V(J)=\left\{\left(\begin{array}{cr}1&z\\0&\pm1\end{array}\right)\mid z\in\mathbf{C}\right\}
$$
is larger than $G$.
