Find an example of a set $A$ and functions $f :B\to B$ and $g:B\to B$ such that $f\circ g=id_B$ but $g\circ f\ne id_B$ Find an example of a set $A$ and functions $f :B\to B$ and $g:B\to B$ such that $f\circ g=id_B$ but $g\circ f\ne id_B$.


I am not sure what $id_B$ means, so I don't understand how to find a set of functions for this. What is $id_B$ and how do you find functions for it? 

I know what it means to find functions such that $f\circ g=f$ and similar to this, but now idea how to do this for $id_B$.

An example for $f\circ g=f$ is
$$
f(x)=x+3; \qquad g(x)=x
$$
then $f\circ g=f(g(x))=f(x)=x+3$.

Is there an easier way to find these than trying random equation?
(I'm reading $A$ as $B$.) 

For any set $X$ the map ${\rm id}_X$ is the identity map of $X$, and is defined as
$${\rm id}_X:\quad X\to X,\qquad x\mapsto{\rm id}(x):=x\ .$$
Here is an example of the required kind:

Let $B:={\mathbb N}_{\geq0}=\{0,1,2,3,4,\ldots\}$, and define
$$g:\ B\to B,\quad k\mapsto g(k):=2k;\qquad f:\&gt;B\to B,\quad n\mapsto f(n):=\left\lfloor{n\over2}\right\rfloor\ .$$
Then $f\circ g={\rm id}_B$. On the other hand $g\circ f\ne{\rm id}(B)$ since $g\circ f(1)=0\ne1$.
Hint: If $f \circ g = \textsf{id}_B$, then it follows that $f$ is surjective (onto) and $g$ is injective (one-to-one). Thus, try finding a set $B$ and any function that is surjective but not injective (or injective but not surjective). Work out a pseudo-inverse for the other function, and you're done!