Prove that a subset of $\mathbb{Z}$ is a subgroup. Came across an interesting question regarding subgroups of $\mathbb{Z}$. Let $A \subseteq \mathbb{Z}$ such that $0 \in A$, $A = -A$ (for every element in $A$, its negative is also in $A$), and $A + 2A \subseteq A$ (for every $a,b \in A $, $a+2b \in A$). We need to prove that this implies $A$ must be a subgroup of $\mathbb{Z}$. Moreover, we need to show that this does not necessarily hold for $A \subseteq \mathbb{Z}^2 $ which has the same properties.
Proving subgroups seems to be a challenge, since you get associativity, identity, and inverse for free. However, you cannot prove closure by manipulating the elements (atleast I cannot). I think the solution lies in the second part of the answer, where $A$ has some property that only exists as a subset of $\mathbb{Z}$ and not $\mathbb{Z}^2$. Any help would be appreciated.
 A: First consider the case $A\subseteq \mathbb{Z}$ . . .

If $A=\{0\}$, then $A$ is the trivial subgroup of $\mathbb{Z}$.

Suppose $A\ne\{0\}$.

Since $A$ is closed under negation, $A$ must have a least positive element, $a$ say.

Claim:$\;A=\langle{a}\rangle\;$(the cyclic subgroup of $\mathbb{Z}$ generated by $a$).

Proof:

By an easy induction, $0+2ka\in A$ for all nonnegative integers $k$.

Thus  if $n$ is an even nonnegative integer, then $n=2k$ for some nonnegative integer $k$, hence $na=2ka=0+2ka\in A$.

Similarly, by an easy induction, $a+2ka\in A$ for all nonnegative integers $k$.

Thus if $n$ is an odd positive integer, then $n=2k+1$ for some nonnegative integer $k$, hence $na=(2k+1)a=a+2ka\in A$.

Combining both cases, and noting that $A$ is closed under negation, it follows $na\in A$ for all integers $n$.

Hence $\langle{a}\rangle\subseteq A$.

To show $A=\langle{a}\rangle$, suppose instead that we have the proper inclusion $\langle{a}\rangle\subset A$.

Then $A{\setminus}\langle{a}\rangle\ne{\large{\varnothing}}$. 

Our goal is to derive a contradiction.

Since $A$ is closed under negation, and $0\in A$, it follows that $A{\setminus}\langle{a}\rangle$ has a least positive element, $b$ say.

By minimality of $a$, we must have $b > a$.

By hypothesis $b-2a\in A$ and since $b\not\in\langle{a}\rangle$, it follows that $b-2a\in A{\setminus}\langle{a}\rangle$.

Since $b-2a < b$, the minimality of $b$ implies $b-2a < 0$.

Thus, $a < b < 2a$.

By hypothesis $2a-b\in A$ and since $b\not\in\langle{a}\rangle$, it follows that $2a-b\in A{\setminus}\langle{a}\rangle$. 

But from $a < b < 2a$, we get $0 < 2a - b < b$, contrary to the minimality of $b$.

This completes the proof.

Next consider the case $A\subseteq \mathbb{Z}^2$ . . .

To show that $A$ need not be a subgroup of $\mathbb{Z}^2$, consider the set
$$A=\{(x,y)\in\mathbb{Z}^2\mid\;\text{at least one of $x,y$ is even}\}$$
Then $A$ satisfies the hypothesis, but $A$ is not closed under addition since $(1,0)\in A$ and $(0,1)\in A$, but $(1,1)\not\in A$.
A: Our goal is to prove that for all $a, b\in A$, $a+b\in A$. The result then follows.
Lets start by proving a rather interesting variant of Bézout's identity, which classically says that given $a, b\in\mathbb{Z}$, there exist integers $p, q\in\mathbb{Z}$ such that $\gcd(a, b)=pa+qb$. We show that we may assume that one of these integers $p$ or $q$ is even.
Lemma. Given $a, b\in\mathbb{Z}$ there exist integers $p, q\in\mathbb{Z}$ such that $\gcd(a, b)=pa+qb$, and either $p$ or $q$ is even.
Proof. We know that there exists some pair $(x, y)\in\mathbb{Z}^2$ such that $\gcd(a, b)=xa+yb$. If one of $x$ or $y$ is even then there is nothing to prove, so assume that both are odd. Set:
\begin{align*}
p&=x+\frac{b}{\gcd(a,b)}\\
q&=y-\frac{a}{\gcd(a,b)}
\end{align*}
It is straightforward to verify that $\gcd(a, b)=pa+qb$:
\begin{align*}
\gcd(a, b)
&=xa+yb\\
&=xa+yb+\frac{ab}{\gcd(a,b)}-\frac{ab}{\gcd(a,b)}\\
&=\left(x+\frac{b}{\gcd(a,b)}\right)a+\left(y-\frac{a}{\gcd(a,b)}\right)b\\
&=pa+qb
\end{align*}
Finally, one of $p$ or $q$ is even: by properties of $\gcd$, one of $\frac{a}{\gcd(a,b)}$ or $\frac{b}{\gcd(a,b)}$ is odd, and so as $x$ and $y$ are both odd, and as odd+odd=even, we have that one of $p$ or $q$ is even, as required. QED

We now return to the question. Firstly, suppose $a\in A$. Then, as observed in the comments, we can use induction and the identity $A+2A\subset A$ to prove that $ka\in A$ for all odd integers $k\in\mathbb{Z}$. Moreover, the identity $A+2A\subset A$ implies that $0+2ka\in A$, and so $ka\in A$ for all integers $k\in\mathbb{Z}$. Therefore, the subgroup $\langle a\rangle$ of $\mathbb{Z}$ is contained in $A$.
Now, suppose $a, b\in A$. Then, as $pa, q'b\in A$ for all $p, q'\in\mathbb{Z}$, we have $pa+2q'b\in A$. By the above lemma, $\langle \gcd(a, b)\rangle\subset A$. By the definition of $\gcd$, this implies that $a+b\in\langle \gcd(a, b)\rangle$ and so $a+b\in A$ as required.
A: If $A \subseteq \mathbb Z$ then $0 \in A$ and if $a\in A$  then $-a\in A$, too. By induction we can show that
$$ \{a,3a,5a,\ldots\}\subseteq A$$
$$\{0,2a,4a,\ldots\}\subseteq A$$
$$\{ -a,-3a,-5a,\ldots\}\subseteq A$$
$$\{0,-2a,-4a,\ldots\}\subseteq A$$
and so
$$\{ka|k\in\mathbb Z\}\subseteq A$$
Therefore if $A\ne\{0\}$ then $A$ contains positive and negative numbers. Let's assume that $a$ is the smallest positive number of $A$ and $b$ is another positive number of $A$, then by division we get integer numbers $q\ge0$ and $0\le r\lt a$ such that
$$b=aq+r$$
But $r=b-qa\in A$ and so $r=0$ because it is less than $a$
So $b$ and also $-b$ are multiples of $a$ and so $$A=\{ka|k\in\mathbb Z\}$$
if $a$ is the smallest positive number of $A$.
These arguments cannot be transferred to the case $A\subseteq \mathbb Z^2$ because no relation similar to $\le$ exists and the division algorithm does not work. Others have given counter examples for $A\subseteq \mathbb Z^2$ .
