Question about this proof (exactness of a sequence) In Altman-Kleinman "Introduction to Grothendieck Duality Theory", page 104 there is the following Lema:

I don't understand the underlined part, why the exactness of that sequences implies the map is the inverse of $h$?
 A: Let me rewrite the things more explicitly:
Since $\newcommand{\coker}{\operatorname{coker}} \newcommand{\Hom}{\operatorname{Hom}} \newcommand{\im}{\operatorname{im}}$$0 \to \Hom(N'',\coker g) \stackrel{g^*}{\to} \Hom(N,\coker g)$ is exact, $g^*$ is injective, and then, if $\pi : N'' \to \coker g$ is the canonical projection, $g^*(\pi) = \pi \circ g = 0$ implies that $\pi = 0$. Thus $\coker g = \im \pi = 0$, meaning that $g$ is surjective.
Since $\Hom(N'',N'') \stackrel{g^*}{\to} \Hom(N,N'') \stackrel{f^*}{\to} \Hom(N',N'')$ is exact, $(g \circ f)^* = f^* \circ g^* = 0$, and in particular $0 = (g \circ f)^*(\operatorname{id}_{N''}) = \operatorname{id}_{N''} \circ\, (g \circ f) = g \circ f$, which implies that $\im f \subseteq \ker g$, and then $g$ induces a homomorphism $h : \coker f \to N''$ such that $h(n+\im f) = g(n)$ for every $n \in N$.
Now, $\Hom(N'',\coker f) \stackrel{g^*}{\to} \Hom(N,\coker f) \stackrel{f^*}{\to} \Hom(N',\coker f)$ is exact, so, if $\pi : N \to \coker f$ is the canonical projection, $f^*(\pi) = \pi \circ f = 0$ implies that $\pi \in \ker f^* = \im g^*$, meaning that $\pi = g^*(j) = j \circ g$ for some homomorphism $j : N'' \to \coker f$. In other words, $j(g(n)) = n+\im f$ for all $n \in N$, that is, $j$ is the inverse of $h$.
