Consider the operation defined on $\mathbb{N}$ by $x*y=\gcd(x,y)$.
I have two subpoints to solve in this problem. The first is:
$i)$ Prove that $(\mathbb{N}, *)$ is a commutative monoid
After proving that $*$ is an operation on $\mathbb{N}$, proving commutativity, and proving associativity (this was a bit harder than the other things to prove), the only thing that I had to prove was that $(\mathbb{N}, *)$ has an identity element. Meaning I have to prove that there $\exists$ $e \in \mathbb{N}$ such that $x * e = e * x = x$, $\forall$ $x \in \mathbb{N}$. So I chose $e = 0$ as the identity element, since $x * 0 = 0 * x = x$, $\forall$ $x \in \mathbb{N}$.
Having these $4$ conditions, we can conclude that $(\mathbb{N}, *)$ is a commutative monoid. The second suboint is:
$ii)$ Show that $D_n = \{ x \in \mathbb{N}: \hspace{0.25cm} x\mid n \}$ is a stable subset of $(\mathbb{N}, *)$ and $(D_n, *)$ is a commutative monoid.
Through a bit of work, I managed to show the first part of this $ii)$. However, in the second part, I have to show that $(D_n, *)$ is a commutative monoid. We can prove that $(D_n, *)$ is an operation using the first part of $ii)$ (so $*$ is an operation on $D_n$ because $D_n$ is a stable subset of $(\mathbb{N}, *)$) and we can prove commutativity and associativity in a similar manner as we did in subpoint $i)$. The problem I have is with the identity element.
I used $0$ as the identity element in subpoint $i)$, but I can't use $0$ here, since $0$ is not a divisor of any number, so $0 \notin D_n$ for any $n \in \mathbb{N}$. So I can't use that as the identity element. I though of using $e = x$ as the identity element for every $x \in D_n$, since $\gcd(x, x) = x$. But then we wouldn't really have the condition:
$$\exists \hspace{0.2cm} e \in D_n \hspace{0.2cm} \text{such that} \hspace{0.2cm} x * e = e * x = x \hspace{0.2cm}, \forall x \in D_n$$
But, rather, we would have it the other way around:
$$\forall x \in D_n, \hspace{0.2cm} \text{there} \hspace{0.2cm} \exists \hspace{0.1cm} e\in D_n \hspace{0.2cm} \text{such that} \hspace{0.2cm} x * e = x * e = x$$
So I don't think this is right, since the condition met goes the other way around, although I am not sure.
So how could I prove that $(D_n, *)$ is a commutative monoid? $0$ is not among $n$'s divisors so I can't use $0$ as the identity element. But a commutative monoid needs an identity element. What am I missing here?