Let's say you have a category, and you are looking at two arrows, $f$ and $g$, such that $fg$ is defined. You know that $g$ and $fg$ are isomorphisms, meaning there are arrows that are both their right and left inverses. What is the proof that $f$ is isomorphic? It appears that $g(fg)^{-1}$ would be the inverse, since
$$f(g(fg)^{-1})=(fg)(fg)^{-1}=Id_{IrrelevantPoint}$$
But I have no idea how to show that
$$(g(fg)^{-1})f=Id_{AnotherIrrelevantPoint}$$
If I could "distribute" the inverse, that would be helpful. I almost feel like what I am trying to proof is false, and the book is lying to me.
Note: In my book's definition at least, isomorphisms do not need to be unique. Take $(fg)^{-1}$ above to be an arbitrary inverse.
Note: In this section of the book, it was discussing monomorphisms and epimorphisms. I don't think it is relevant though.
Using the associative law to omit a lot of parentheses, and using that $gg^{-1}$ and $(fg)^{-1}fg$ are identity maps, which I abbreviate as $I$, we have $$g(fg)^{-1}f=g(fg)^{-1}fgg^{-1}=gIg^{-1}=I.$$