Let $A\left(E,\ E \right)$ be the set of applications from $E$ to $E$ itself.
We equip $A$ with the operation of composition $\circ$.
Question: Which elements $f \in A$ are right regular?
Answer:
$f \in A$ is right regular on $\left( A,\ \circ \right)$ iff it satisfies the following implication:
$$h \circ f=g \circ f \Rightarrow h = g$$
Let us assume that $$h \circ f=g \circ f$$ $$\Leftrightarrow \left( \forall x \in E \right):\ h \circ f(x)= g \circ f(x)$$
$$\Leftrightarrow \left( \forall x \in E \right):\ h(f(x))= g(f(x))$$
A got stuck here, because I dont't know what must $f$ satisfy n order to conclude $\color{red}{\Rightarrow h = g}$
I appreciate any suggestions.
If $f$ is surjective, then the equality $h\circ f=g\circ f$ implies that$$(\forall x\in A):h(x)=g(x),$$since each $x\in A$ is equal to $f(y)$, for some $y\in A$. Therefore,$$f\text{ surjective}\implies f\text{ right regular.}$$Can you prove the opposite implication?