I'm reading about unital categories to get a better understanding of nonlinear algebraic categories like groups, monoids, semigroups, magmas etc.
A unital category is a pointed finitely complete category in which the unit injections $(1,0):A\to A\times B$ are jointly extremally epimorphic (=surjective all the examples above). The motivation is the equalities $(a,b)=(1,b)(a,1)=(a,1)=(1,b)$ which hold starting from magmas.
If the category has coproducts (all the examples do), then this joint extremal epimorphy implies the extremal epimorphy of the canonical arrow given by the identity matrix $$A\amalg B\to A\times B.$$
Thinking concretely this means the arrow is surjective. But doesn't that mean every $(a,b)$ is either of the form $(a^\prime ,1)$ or $(1,b^\prime)$? That doesn't seem to be the case for unital magmas... What's going on here? Also, what's an example in which this arrow is not injective? It would seem to involve $(a,1)=(1,b)$ with $a,b\neq 1$... I'm confused. (As Vladimir Sotirov points out, I have made the classical mistakes of treating the underlying set of a coproduct as the coproduct of underlying sets.)
How can I describe this arrow concretely for general nonlinear algebraic theories?
For such theories I think $A\amalg B$ is always a kind of free product. I think one way to see this is by proving free products are coproducts of unital magmas since the rest follows by enlarging the equivalence relations we quotient by. Now, the free product of two unital magmas $A,B$ has for elements sequences in the alphabet comrpised of the underlying sets $UA\amalg UB$ , and we quotient by the relations present in $A$ and in $B$. I haven't checked the details but I do think this does realize a coproduct. For convenience we henceforth deal with associative unital magmas. Now, the only canonical arrow $A\amalg B\to A\times B$ which I can think of takes a word $\prod _ix_i$ and maps it into the ordered pair comprised of the products of the elements in the respective factor e.g $$a_1a_2b_1a_3b_2b_3b_2a_2\mapsto(a_1a_2a_3a_2,b_1b_2b_3b_2).$$ However, I have no idea how to show/check/prove this is actually the map given by the identity matrix.
How can I prove the described map is actually the canonical map $A\amalg B\to A\times B$?
To understand the map $A\coprod B\to A\times B$, just look to its definition. It is defined to be the unique map induced by the identity maps $A\to A$ and $B\to B$ and the zero maps $A\to B$ and $B\to A$. Now, as you say, every element of $A\coprod B$ can be written as a formal "word" in elements of $A$ and $B$ using whatever algebraic operations you have (it seems you are only looking at examples where you have at most a binary operation, possibly with an identity element). Moreover, given maps $f:A\to C$ and $g:B\to C$, the induced map $A\coprod B\to C$ just takes a word and applies $f$ to the parts of it that are from $A$ and applies $g$ to the parts of it that are from $B$, and then evaluates using the algebraic operations in $C$.
For the map $A\coprod B\to A\times B$, this means that it sends a word $w\in A\coprod B$ to $(p(w),q(w))$, where $p(w)$ is obtained by applying the zero map $B\to A$ to all the symbols in $w$ that come from $B$, and then evaluating in $A$, and $q(w)$ is obtained by doing the same but with $A$ and $B$ reversed. To understand what this looks like, you just have to understand what your zero maps are. The zero map $0:A\to B$ always just maps every element of $A$ to the distinguished element of $B$, which in examples like monoids and groups is the identity element. So in those cases $p(w)$ is the product of elements of $A$ you get by just "removing" all the elements of $B$ from $w$ (since you replace them by the identity), and $q(w)$ is the product of elements of $B$ you get by just removing all the elements of $A$ from $w$. This is exactly what you've described.
However, your description isn't quite accurate if the distinguished element of your structures is not an "identity" element. For instance, consider the category of semigroups together with a distinguished element $x$ which satisfies $x^2=x$. This category is pointed (the zero map sends every element to $x$), but the map $A\coprod B\to A\times B$ sends a word like $a_1b_1a_2b_2$ to $(a_1xa_2x,xb_1xb_2)$, rather than $(a_1a_2,b_1b_2)$. This category is not unital, though (the map $A\coprod B\to A\times B$ is not always surjective). For a unital example, you could consider sets with two associative binary operations $\cdot$ and $*$ and a distinguished element $1$ which is an identity for $\cdot$ and satisfies $1*1=1$. This is unital because the word $a\cdot b\in A\coprod B$ will always map to $(a\cdot 1,1\cdot b)=(a,b)$, but a word like $a*b$ will map to $(a*1,1*b)$ rather than just $(a,b)$.