i have been working on "Module Theory:An Approach to Linear Algebra" by T. S. Blyth and i am stuck on exercise 4.4 which is
"Let $f: M \to N $ be an $R$-morphism. By a cokernel of $f$ we mean a pair $(P,\pi)$ consisting of an $R$-module $P$ together with an $R$-epimorphism $\pi: N\to P$ such that
(1) $\pi \circ f = 0$
(2) for every $R$-module X and every $R$-morphism $g:N\to X$ such that $g\circ f = 0$ there is a unique $R$-morphism $\alpha: X\to P$ such that $\pi = g \circ \alpha$.
Prove that $(N/Imf, \phi)$ ($\phi$ is the canonical mapping) is a cokernel of $f$. "
(1) is not that hard, but for (2) i can only prove that there exist a unique $R$-morphism $h:N/Imf \to X$ not the other way around which is required. Am i missing something? Is it possible that the definition of the cokernel is wrong? Thanks
Yes, there is an error in the exercise. It should be a map $\alpha : P \to X$ such that $\alpha \circ \pi = g$. Then you can prove that $(N/ \operatorname{im}f, \phi)$ is a cokernel thanks to their theorem 4.4.
Otherwise, with the wrong definition, you could e.g. take $P = 0$, and this would satisfy the conditions of the exercise; but it's clearly not what a cokernel should be.