I am reading Awodey's "Category Theory" by myself and got stuck in a simple passage. He writes:
If $g:A^\ast\rightarrow N$ satisfies $g(a)=f(a)$ for all $a\in A$ then, for all $a_1,\ldots,a_i\in A$: $g(a_1\ldots a_i)=g(a_1\ast\ldots \ast a_i)=g(a_1)\cdot_N \ldots \cdot_N g(a_1) =$
where $A^\ast=\{ \text{ words over } A\}$; " $\ast$ " is the concatenation ; $N$ is an arbitrary monoid; and "$\cdot_N$" is the monoid $N$'s binary operation.
Chances are I am missing something very obvious but I can not see how the second inequality, $g(a_1\ast\ldots \ast a_i)=g(a_1)\cdot_N \ldots \cdot_N g(a_1)$, follows. Are we making some implicit assumption about $g$?
It seems that the specific passage you're referring to is the one that deals with the uniqueness of the map $\overline{f}:M(A)\rightarrow N$ ($M(A)$ is the notation that Awodey uses in my copy of his text for what you're calling $A^\ast$) with the property that $|\overline{f}|\circ i= f$.
He then says
Note that Awodey is making a distinction between sets and monoids through his explicit use of the forgetful functor $|\cdot|:\mathbf{Mon}\rightarrow \mathbf{Set}$; since these aren't written as $|M(A)|$ and $|N|$, we can reasonably (and should!) assume that this is a morphism in $\mathbf{Mon}$, i.e. a monoid homomorphism.
Plus, he is trying to show that $g=\overline{f}$; unless these are both in the same category, this doesn't really make any sense.