Group of groups The product $\times$ of two groups is associative and commutative and there's a neutral element $\{1\}$.  Let's say I create "virtual groups" which are inverses with respect to $\times$ (like getting $\mathbb{Z}$ from $\mathbb{N}$).  Then I have a group $G$ whose elements are all groups.
This isn't allowed, though, is it?  Since a set can't be a member of itself.
 A: As Brian notes, there's no problem with a group whose elements are groups. Take your two favorite groups, let's call them $A$ and $B$, let $G=\{{A,B\}}$, and define a binary operation on $G$ by $$AA=BB=A,\quad AB=BA=B$$ Voila! a group whose elements are groups. 
A: In addition to the problems mentioned by Brian Scott, there is another problem.
You seem to be trying to mimic the construction of the enveloping group of a semigroup (this is the image of the adjoint functor to the forgetful functor from $\mathsf{Group}$ to $\mathsf{Semigroup}$ or to $\mathsf{Monoid}$); in the commutative case, this is often called the Grothendieck group. Generally, you do not have an embedding of the original semigroup into the enveloping; you need the semigroup to be cancellative for that to hold. 
But in this setting, there are groups $A$, $B$, and $C$, pairwise nonisomorphic, such that $A\times B\cong A\times C$. That would mean that in the enveloping group, we would need to identify $A$ with the trivial group, or $B$ with $C$. You are going to have a lot of collapse in this resulting object. For example, if your class of groups includes the infinite direct product of copies of $\mathbb{Z}$, and this group is not identified with the trivial group, then every finite rank free abelian group will be identified with each other (a less than desirable outcome). 
You could get away with doing this for, say, finite groups. You can even do it within ZFC, by restricting the groups to having underlying set contained in a particular infinite set. Then, under the equivalence relation of "isomorphism" you have a cancellative commutative monoid under cartesian product, so you can construct the Grothendieck group by adjoining "formal inverses". I don't think you get anything particularly interesting, though: the monoid is free abelian on the indecomposable groups, and so the Grothendieck group is just free abelian on the indecomposable groups.
A: The Cartesian product is not commutative: if $G\ne H$, $G\times H\ne H\times G$, though these groups are isomorphic. It isn’t associative, either, because $\big\langle\langle x,y\rangle,z\big\rangle\ne\big\langle x,\langle y,z\rangle\big\rangle$, though once again there’s an isomorphism between $(G\times H)\times K$ and $G\times(H\times K)$.
That aside, there’s no problem in principle with having a group $G$ whose elements are themselves groups; $G$ simply won’t be one of those elements. What you can’t do is form a group $G$ whose elements are all possible groups, any more than you can form a set of all sets. 
What you can do in ZF is write down a first-order formula $\varphi(x)$ that ‘says’ that $x$ is a group, meaning an ordered pair $\langle y,z\rangle$ such that $y$ is a set and $z$ is a function from $z\times z$ to $z$ with the properties needed to make it a group operation on $y$. You can then write down formulas $\psi(x,y,z)$ that ‘say’ that $x,y$, and $z$ are groups and that $z$ is related to $x$ and $y$ in some specific fashion. I shouldn’t be at all surprised if it were possible to find such a formula for which one could prove 
$$\forall x,y\Big(\big(\varphi(x)\land\varphi(y)\big)\to\exists!z\psi(x,y,z)\Big)\;,$$
i.e., $\psi$ defines what would be a binary operation on groups if the set of all groups existed,
$$\forall u,v,w,x,y,z\left(\Big(\psi(x,y,u)\land\psi(y,z,v)\Big)\to\Big(\psi(u,z,w)\leftrightarrow\psi(x,v,w)\Big)\right)\;,$$
i.e., that ‘operation’ is associative, and the rest of the group axioms. Then one could talk informally about the proper class $\bf{G}$ of groups and a proper class operation making $\bf G$ into a group.
