Does function composition with the set of all functions from $A$ to $B$ form a monoid

abstract-algebrafunctionsmonoid

Let $A = \{a, b, c\}$ and $B = \{a, b\}$. Denote the set of all functions $f : A \to B$ as $F$ and denote function composition in the typical way, i.e., $f \circ g = f(g(x))$.

Is this a monoid? From my perspective, I don't think so. If $A = B$ then we can easily find an identity element but I am having difficulty finding one here where $A \neq B$.

Edit: ignore this part In particular, I can find a left inverse $e$ but not a right inverse. I'm not sure if I'm just missing how to find the right inverse. If there is truly no right inverse, how do I prove that?

Best Answer

Inverses aren't relevant for monoids, but since you wrote about inverses, consider what I initially wrote below.

According to Wikipedia, an function $f$ has a left inverse (or is the empty function) if and only if it is injective. A function $f$ has a right inverse if and only if it is surjective.

Based on these, you can find right inverses for some elements of $F$, but no element of $F$ will have a left inverse.

There are only $2^3 = 8$ functions from $A$ to $B$, so you could just check them all and show none of them is an identity element.