Show that for each of the following graphs G there exists up to isomorphism precisely one category A with G(A) = G. I was working through the exercises in Abstract and Concrete Categories: The Joy of Cats (http://katmat.math.uni-bremen.de/acc/acc.pdf) and I was stuck on exercise 3A.(d). 
It seems to me that the graphs in question do not determine a unique category up to isomorphism, since there is ambiguity in how to compose the endomorphisms which aren't the identity. I was hoping somebody could help me understand why these graphs correspond to unique (up to isomorphism) categories.
Thanks!
 A: Let me show you how to do the first graph; the second graph uses similar ideas but is more complicated.  Let's let $X$ and $Y$ be the two objects, with $f:X\to Y$, $g:Y\to X$, and $h:Y\to Y$ the non-identity morphisms.  The only compositions that are not automatically determined are $fg$ and $h^2$: each of them could be either $h$ or $1_Y$.  Note that $gf:X\to X$ must be $1_X$, since there are no non-identity morphisms $X\to X$.  Now if $fg$ were $1_Y$, then $f$ and $g$ would be inverse isomorphisms, so $X\cong Y$.  This is impossible, since there is a nonidentity morphism $Y\to Y$ but not a non-identity morphism $X\to X$.  (Explicitly, note that $ghf=1_X$ and so if $fg=1_Y$, then $h=1_Yh1_Y=(fg)h(fg)=f(ghf)g=f(1_X)g=fg=1_Y$, which is a contradiction.)
Thus $fg\neq 1_Y$, so $fg=h$.  The only composition that remains to be determined is $h^2$.  But since $fg=h$, $$h^2=(fg)(fg)=f(gf)g=f1_Xg=fg=h.$$  So we have determined the entire composition operation for our category, and so it is unique up to isomorphism.
