# Why is the preservation of identities a funtoriality axiom?

I'm a newbie at category theory and just started reading Emily Riehl's Category Theory in Context. I got to the definition of functors, which contains the following two axioms: if $$F:C\to D$$ is a functor between categories, then

• For every composable pair of morphisms $$f:x\to y$$, $$g:y\to z$$ in $$C$$, $$F(g\circ f)=Fg\circ Ff$$
• For every object $$c\in C$$, $$F\left(1_c\right)=1_{Fc}$$

I'm concerned about the second axiom. For a group homomorphism $$f:G\to G'$$, it's enough to say that $$f$$ respects the group operation, and it follows from there that $$f\left(1_G\right)=1_{G'}$$. On the other hand, it's not enough to say that a ring homomorphism $$g:R\to R'$$ respects both addition and multiplication, for there exist maps that are both additive and multiplicative that don't preserve the multiplicative identity.

I tried coming up with a counterexample with a category consisting of one object and whose morphisms are the elements of a ring; however, this creates two identity morphisms (the additive and multiplicative identity). Even worse, these morphisms aren't necessarily associative.

Are there any examples of almost-functors that obey the first axiom but not the second?

• Take the ring example and forget about the addition. May 18 at 7:26
• Oh fish thank you for the fast reply @ZhenLin ! That seems so obvious in hindsight now... May 18 at 7:30

Let $$\mathcal{1}$$ be the category with a single object (call it $$\bullet$$) and a single morphism, which is the identity morphism on $$\bullet$$.
Let $$\mathcal{C}$$ be the category with one object (call it $$*$$) and a morphism $$f\colon *\to *$$ such that $$f\circ f = f$$. The morphisms $$f$$ and the identity $$\mathrm{id}_*$$ are the only morphisms in this category.
Then we can define an "almost-functor" $$A\colon \mathcal{1}\to\mathcal{C}$$ that maps $$\bullet$$ to $$*$$ and maps $$\mathrm{id}_\bullet$$ to $$f$$.
This almost-functor obeys the composition of morphisms because $$A(\mathrm{id}_\bullet\circ\mathrm{id}_\bullet) = f = A(\mathrm{id}_\bullet)\circ A(\mathrm{id}_\bullet)$$. However, it does not obey the identity axiom because it maps an identity morphism to a non-identity morphism.
• Thank you! I came up with the category of a single object, say $\star$, and morphisms given by integers $n:\star\to\star$. Then, the composition of two morphisms is given by integer multiplication, i.e. $n\circ m=nm:\star\to\star$. Then, take the endofunctor that maps $\star$ to itself and $n:\star\to\star$ to $2n:\star\to\star$. Now that I think about it, any monoid "induces" a category in this way, and any map monoid-homomorphism induces an "almost-functor". May 18 at 7:46