Are there $f: A\rightarrow B$ and $g: B\rightarrow A$ but $g\circ f$ is not identity?

70 Views Asked by At

I am new to category theory.
I found the following definition.

An arrow $f:A\rightarrow B$ is called an isomorphism,
if there is an arrow $g:B\rightarrow A$ such that
$$ g\circ f=\mathrm{id}_A $$ and $$ f\circ g=\mathrm{id}_B . $$

However, it seems clear to me that if $f:A\rightarrow B$ and $g:B\rightarrow A$ ,
then $g\circ f$ is identity and $f\circ g$ is identity,
because it is obvious that if you go from A to B and then from B to A, you go back to A.
So, my question is,
how can it be $f:A\rightarrow B$ and $g:B\rightarrow A$
but $g\circ f\ne \mathrm{id}_A$ or $f\circ g\ne\mathrm{id}_B$ ?

2

There are 2 best solutions below

1
On BEST ANSWER

There can be many morphisms between objects. Consider $A=B=\mathbb{R}$. Then any two real functions can be composed in either order, but only special pairs are inverses of each other!

0
On

Choose $f(x)=-x$ and $g(x)=x$ over the reals. Then $g(f(x))=g(f(x))=-x$ which is not the identity.