Outline
While working on exercise 11, chapter 1 in Awodey's "Category theory" (p. 27, 2nd ed.), I came across what I perceive as a peculiarity of the UMP of free monoids. First, the notation: We are trying to "construct" the free monoid functor $$\mathbf{M} : \mathbf{Sets} \to \mathbf{Mon},$$ and my functions will be $$f : A \to B $$ $$ g : B \to C.$$
The injection functions from a set $A$ to its free monoid $\mathbf{M}A$ are denoted $$ \iota_A : A \to \mathbf{M}A .$$
Problem
My problem as I see it is that I cannot construct the free monoid functor without the "injection functions" $\iota_A, \iota_B$ : one has to apply the UMP to $\iota_B \circ f$, not to $f$. Thus it is hard to prove $$\mathbf{M}(g \circ f) = \mathbf{M}g \circ \mathbf{M}f$$
since one has to work with $$\mathbf{M}(\iota_C \circ g \circ f) .$$
I am able to prove a variant; briefly, $$ \mathbf{M}((\iota_C \circ g) \circ f) = \mathbf{M}(\iota_C \circ g) \circ \mathbf{M}(\iota_B \circ f), $$ but it feels rather unsatisfying to say "It's a functor, if one disregards that one has to inject the elements from the base sets into the monoid as the final step" (this sentence is modulo nitpicking).
Question
How should I resolve this? Am I plainly wrong, or do I have to take the handwavy approach and laugh the matter off, saying "details, details"? I usually find that I can resolve these things with a bit of work, but this one eludes me.
We have: $M(g \circ f)$ is the unique morphism $h: M(A) \to M(C)$ such that $i_C \circ g \circ f = h \circ i_A$.
Now, $M(g) \circ M(f)$ is a morphism $M(A) \to M(C)$. Moreover we have $M(g) \circ M(f) \circ i_A = M(g) \circ i_B \circ f = i_C \circ g \circ f$.
So $M(g \circ f) = M(g) \circ M(f)$.