Is a commutative monoid with a $\mathbb Z$-action an abelian group? Let $M$ be a commutative monoid and let there be an action of $\mathbb Z$, i.e., a function $\mathbb Z\times M\to M$ such that for $r,s\in\mathbb Z$ and $m,n\in M$ we have:
\begin{equation}
\left(r+s\right)\cdot m=r\cdot m+s\cdot m\\
r\cdot\left(m+n\right)=r\cdot m+r\cdot n\\
r\cdot\left(s\cdot m\right)=\left(rs\right)\cdot m\\
1\cdot m=m
\end{equation}
Then is $M$ actually an abelian group with inverses given by $\left(-1\right)\cdot m$?
Note that such an action would be extension of the natural action of $\mathbb N$ on $M$.
 A: Let $M$ be the monoid $\{0,1\}$ under $\max$; denote the monoid operation by $\ast$, noting that $m\ast m=m$ for each $m\in M$. Define a $\mathbb{Z}$-action on $M$ by taking $r\cdot m=m$ for all $r\in\mathbb{Z}$ and $m\in M$. Let's verify that your axioms for a $\mathbb{Z}$-action hold; fix $r,s\in \mathbb{Z}$ and $m,n\in M$. We have:

*

*$(r+s)\cdot m=m=m\ast m=(r\cdot m)\ast (s\cdot m)$.

*$r\cdot (m\ast n)=m\ast n=(r\cdot m)\ast (r\cdot n)$.

*$r\cdot (s\cdot m)=r\cdot m=m=(rs)\cdot m$.

*$1\cdot m=m$.

So this gives a well-defined $\mathbb{Z}$-action. But $M$ is not a group, since – for example – $1\in M$ has no inverse.

This example generalizes to any commutative monoid $(M,\ast)$ such that $m\ast m=m$ for all $m\in M$. No such monoid with more than one element can be a group, but taking $r\cdot m=m$ for each $r\in\mathbb{Z}$ and $m\in M$ will satisfy your axioms for a $\mathbb{Z}$-action on $M$.
A: Atticus' answer already solves this.
Here's an additional observation: Let $(M, +, 0_M)$ be a commutative monoid with a $\Bbb Z$-action. Then, $M$ is a group iff $M$ is cancellative.
$(\Rightarrow)$ is clear since groups are cancellative.
$(\Leftarrow)$ Suppose $M$ is cancellative.
Claim 1. $0 \cdot m = 0_M$ for all $m \in M$.
Proof. This is the typical proof. Note that
$$0 \cdot m = (0 + 0) \cdot m = 0 \cdot m + 0 \cdot m$$
and use cancellation. $\Box$
Claim 2. Let $m \in M$. Then, $(-1) \cdot m$ acts as an inverse for $m$.
Proof. We have $(-1 + 1) \cdot m = 0_M$ and $1 \cdot m = m$. $\Box$
Thus, every element has an inverse and we are done.

This shows that some familiar examples such as $(\Bbb N_0, +, 0)$ and $(\Bbb Z \setminus \{0\}, \cdot, 1)$ cannot have a $\Bbb Z$-action. (Since they are cancellative but are not groups.)
