Injective and Projective module Ok, this problem is driving me nuts. At first, I thought I did it. But when reading another textbook (having a similar proposition, they (the problem in my textbook, and the proposition in the other book) are not exactly the same), so I went over my work again, and figured out a big flaw in my work, so I redid it, but I just couldnot complete it. Here is the problem of my textbook:

Problem
Notice: In the following problem $A$; $J$, and $P$ are all $R-$modules.
Prove that $J$ is injective iff for every epimorphism $f:A \to J$, and monomorphism $g:A \to P$ (where $P$ is some projective module), there must exist a homomorphism $\varphi: P \to J$, such that $\varphi g = f$.

And the other version is without the epimorphism part, it just requires $f$ to be any module map.
And here's my work


*

*The $\Rightarrow:$ part should be straight-forward from the definition of injective modules.

*Now, the $\Leftarrow:$ part. I'll prove $J$ injective, by proving that every short exact sequence of the form $0 \to J \xrightarrow{\chi} A \xrightarrow{\sigma} B \to 0$ splits. And to prove that, my aim is to construct an inverse of $\chi$.
So consider the following diagram:


Where $R^A$, and $R^J$ are respectively free modules generated by elements of $A$, and $J$. $i$ is the natural injection, since $J$ can be thought of as a submodule of $A$, and $p_1$, $p_2$ are epimorphisms.
Since $R^A$ is free, hence projective. So according to the problem, there exists $\gamma: R^A \to J$, so that the bottom left triangle commutes.
At first, I thought I can construct $\beta: A \to J$ by using the on to property of $p_2$, i.e, for every $a \in A$, there exists $(\alpha_i)_{i \in A} \in R^A$, such that $p_2((\alpha_i)_{i \in A}) = a$. And I can define $\beta (a) = \gamma((\alpha_i)_{i \in A})$. However, with that definition, I cannot prove that $\beta$ is well-defined, let alone, a module map, and I don't really think it's a map at all. But, maybe I'm wrong.
So, can someone help me, am I missing something here? Or is the book wrong? Or should I start with a different way?
Thanks everyone,
And have a good day,
 A: I think it could be easier to work directly with the basic definition of injectivity, i.e. that if $A \hookrightarrow B$ is an embedding, then any $A \to J$ extends to $B$.
Now you are supposed to reduce to the case when $A \to J$ is surjective, 
and $B$ is projective.  You can always just add a copy of $J$ to $A$ and $B$ to
get surjectivity.  And you can always write $B \oplus J$ as a quotient of some projective $P$ and form an appropriate pull-back to assume $B$ is projective.
I leave the details to you.
A: Ok, so I've been working on this problem for more than half a day, and finally it pays off. I don't really know if there's any flaws left in this solution, but it seems true to me. It's midnight here, and I may make some kind of stupid mistake. So if someone can confirm it for me, I would be very glad.
My aim is to use Baer's criterion to solve it. So for every injective $i: I \to R$, and for every homomorphism $f: I \to J$, I need to lift it to some $g: R \to J$.


*

*If $f$ is epi, then it's done, since $R$ is free, hence projective.

*If $f$ is not epi, I construct an epimorphism $\gamma: R^J \to J$. So we have the following diagram:
$\begin{array}{ccc} I \oplus R^J & \xrightarrow{i\oplus\mbox{id}_{R^J}} & R \oplus R^J \\ \downarrow^{\tilde{f}} \\ J \end{array}$


where $\tilde{f}(i; (r_k)_{k \in J}) = f(i) + \gamma((r_k)_{k \in J})$, since $\tilde{f}$ is epi, and $i \oplus \mbox{id}_{R^J}$ is injective, and $R \oplus R^J$ is free hence projective, so there's a homomorphism $\varphi: R \oplus R^J \to J$, such that the diagram commutes. It's easy to see that $g = \varphi \circ j$ is the module map I'm looking for, where $j$ is an injective map from $R$ to $R \oplus R^J$, i.e $j(b) = (b; 0_{R^J})$.
Does this look good?
