All groups $(G, \cdot)$ such that $\forall g_1, g_2 \in G, g_1,g_2 \in G \iff g_1 \cdot g_2 \in G$? I want to find a group $(G, \cdot)$ (group $G$ with a binary operation $\cdot$) such that for all elements $g_1, g_2 \in G$, the following holds:
$$
g_1 \cdot g_2 \in G \iff g_1, g_2 \in G \tag{1} \label{1}
$$
The converse is always true because it is one of the definitions of being a group. That is,

Closure: If $g_1, g_2 \in G$, then $g_1 \cdot g_2 \in G$, for all $g_1, g_2 \in G$.

It seems impossible because there is a counterexample in this post I wrote.
Is this possible? That is, is there a group $(G, \cdot)$ for $\eqref{1}$ to be true?
I tried using conjugacy classes, but conjugacy classes are just sets. Any suggestions?
Thanks.
 A: You are certainly right that
$$
g_1,g_2 \in G\Rightarrow g_1\cdot g_2 \in G
$$
is apart of the axioms for a group and so is correct. The issue lies with the opposite statement
$$
g_1\cdot g_2 \in G\Rightarrow g_1,g_2 \in G
$$
which, without further context, is nonsensical. To try and explain this, ask yourself: where are ${g_1,g_2}$ being taken from? What group or set do they belong to? If your answer to that is "they come from $G$" then clearly ${g_1,g_2 \in G}$, but this is a rather trivial statement at this point (you are just saying ${g_1,g_2 \in G\Rightarrow g_1,g_2 \in G}$). So in order for us to have a non-trivial statement, ${g_1,g_2}$ must be coming from somewhere outside of $G$, but you have not been specific in describing exactly where they come from and how $G$ comes into this at all. Hopefully that helps, if not let me know and I'll try to explain further
EDIT: my mistake, I didn't see in the post you did indeed specify where ${g_1,g_2}$ were to come from, which was indeed $G$. As I say though, this makes the full statement
$$
\forall\ g_1,g_2 \in G: g_1\cdot g_2 \in G\Rightarrow g_1,g_2 \in G
$$
trivially true since you are now specifying that ${g_1,g_2}$ should come from $G$.
A: Riemann'sPointNose has given the answer to your question as written (+1), which is that this is trivially true! Namely, the following statement is trivially true:

Let $(G,\cdot)$ be a group. Then for all $g_1,g_2\in G$ such that $g_1g_2\in G$ we have $g_1,g_2\in G$.

Indeed, you start by assuming that $g_1,g_2$ lie in $G$, and then wish to conclude that $g_1,g_2$ lie in $G$. Do you see why this is a vacuously true statement? The fact that $g_1g_2\in G$ has nothing to do with it, it just follows from the assumption that $g_1,g_2\in G$ to begin with.
However, there's a different way of interpreting your question, which perhaps is more in the spirit of what you were looking for:

For which groups $(G,\cdot)$ is the following true? Whenever $\alpha:G\to G'$ is an injective homomorphism (ie whenever $G$ is "morally" a subgroup of $G'$), we have $ab\in \alpha(G)\implies a,b\in \alpha(G)$ for all $a,b\in G'$.

It turns out that there is no group with this property. In fact, for any homomorphism $\alpha:G\to G'$ of groups, provided that $G'\neq\alpha(G)$ we can always find $a,b\in G'\setminus\alpha(G)$ such that $ab\in\alpha(G)$! Indeed, just pick any $t\in G'\setminus\alpha(G)$, and let $a=t$ and $b=t^{-1}$. So to show that a group $G$ does not have this property we just need to find any group $G'$ with an injective homomorphism $\alpha:G\to G'$ such that $G'\neq\alpha(G)$; for example, we can take $G'=G\times\mathbb{Z}$ and $\alpha(g)=(g,0)$.
I am not sure whether this is a satisfactory answer for you, but thought I'd point it out, as it's in some sense the natural follow-up to the question you asked.
