Extending internal semigroups to internal monoids. Given a semigroup $S$ we can always extend this to a monoid by adjoining a new variable and imposing all required equations. Concretely let $F(S)=S\cup \{1 \}$ with with the equations $s\cdot 1=s=1\cdot s$ for all $s\in S$, and $1\cdot 1 =1$. This construction yields a left adjoint to the forgetful functor from the category of monoids to semigroups which forgets about the identity. I've been studying a little category theory lately and I was curious if I could generalize this procedure to semigroup and monoid objects internal to a monoidal category.
Let $(\mathcal{C},\otimes,1,\alpha,\lambda,\rho)$ be a monoidal category which contains binary coproducts. I think to have any hope of this working we will need to assume that the tensor $\otimes$ distributes over coproducts on both sides. If $(M,\mu:M\otimes M\rightarrow M)$ is a semigroup object, then my thought is that $(M\coprod 1, \mu',\eta)$ is a monoid object such that $\eta$ is the inclusion $1\rightarrow M\coprod 1$ and for $\mu':(M\coprod 1)\otimes (M\coprod 1)\rightarrow M\coprod 1$ im not sure how this should be defined.
Since $\otimes$ distributes over coproducts the domain of $\mu'$ is $(M\otimes M)\coprod (1\otimes M) \coprod (M\otimes 1)\coprod (1\otimes 1)$. There is a natural map $\mu\coprod \lambda_M \coprod \rho_M \coprod \rho_1$ where $\lambda$ and $\rho$ are the left and right unitors. The issue with this choice of map is the codomain is $M\coprod M\coprod M\coprod 1$.
Any help is appreciated, thanks!
 A: You're really close!
All that's left to do is map $M\sqcup M\sqcup M\to M$ by folding: take the universal map induced by the identities $M\to M$ for each summand $M$ on the left.
You can then check that this agrees with the usual construction in $\mathbf{Set}$ that you described above.
Associativity of the resulting multiplication then boils down to the associativity of the multiplication on $M$, and the universal property of coproducts.
For another example of this phenomenon: consider the monoidal category $\def\Ab{\mathbf{Ab}}\Ab$ (with the usual tensor product $\def\Z{\mathbb{Z}}\otimes_\Z$). In this case, a semigroup object is a non-unital ring (a "rng").
As mentioned in the Wikipedia article for rngs, the explicit construction in this case is called the Dorroh extension, which freely adjoins a $1$ to the rng subject to the usual axioms of an identity element.
Starting with a rng $R$, the Dorroh extension is given by taking $\Z\oplus R$ just as you do, and endowing it with the multiplication map $(n_1,r_1)\cdot(n_2,r_2) := (n_1n_2, n_1r_2 + n_2r_1 + r_1r_2)$, as one might expect.
If you write out what this multiplication map is in terms of the morphisms of $\Ab$, you'll find that it is exactly the map you defined, composed with the fold map I mentioned on the top.

To convince yourself that this is correct, you can prove that this construction indeed gives the free monoid on the semigroup:

If $\def\sC{\mathscr{C}}\def\I{\mathbb{I}}(\sC,\otimes,\I)$ is a monoidal category such that $\sC$ has binary coproducts that are preserved by $\otimes$, then the forgetful functor $U:\mathbf{Mon}(\sC)\to\mathbf{Semigrp}(\sC)$ admits a left adjoint $F$ that sends a semigroup $S$ to the monoid $F(S) = \I\sqcup S$ with unit $\I\to\I\sqcup S$ given by the coprojection map, and with multiplication given by $(\I\sqcup S)\otimes(\I\sqcup S)\cong(\I\otimes\I)\sqcup(\I\otimes S)\sqcup(S\otimes\I)\sqcup(S\otimes S)\xrightarrow{\mu_{\I}\otimes\lambda\otimes\rho\otimes\mu_S}\I\sqcup S\sqcup S\sqcup S\sqcup S\xrightarrow{\I\sqcup\nabla}\I\sqcup S$.

Indeed, the proof amounts to observing that semigroup homomorphisms $f:S\to U(M)$ (where $M$ is a monoid in $\sC$) extend to monoid homomorphisms $\I\sqcup S\xrightarrow{\eta_M\sqcup f} U(M)$ via the unit map of $M$, and that every monoid homomorphism $F(S)\to M$ arises in this way (indeed, this is because monoid homomorphisms must preserve the unit map).
