Exact sequences of modules vs. exact sequences of Hom abelian groups I stumbled upon the following theorem in Dummit and Foote’s Abstract Algebra, Section 10.5:

Theorem 28.
Let $D$, $L$, $M$, and $N$ be $R$-modules.
If
$$
  0
  \longrightarrow L
  \xrightarrow{\enspace \psi \enspace} M
  \xrightarrow{\enspace \varphi \enspace} N
  \longrightarrow 0
$$
is exact, then the associated sequence
$$
  0
  \longrightarrow \mathrm{Hom}_R(D, L)
  \xrightarrow{\enspace \psi' \enspace} \mathrm{Hom}_R(D, M)
  \xrightarrow{\enspace \varphi' \enspace} \mathrm{Hom}_R(D, N)
  \tag{10}
$$
is exact.
A homomorphism $f \colon D \to N$ lifts to a homomorphism $F \colon D \to M$ if and only if $f ∈ \mathrm{Hom}_R(D, N)$ is in the image of $\varphi'$.
In general $\varphi' \colon \mathrm{Hom}_R(D, M) \to \mathrm{Hom}_R(D, N)$ need not be surjective;
the map $\varphi'$ is surjective if and only if every homomorphism from $D$ to $N$ lifts to a homomorphism from $D$ to $M$, in which case the sequence $(10)$ can be extended to a short exact sequence.
The sequence $(10)$ is exact for all $R$-modules $D$ if and only if the sequence
$$
  0
  \longrightarrow L
  \xrightarrow{\enspace \psi \enspace} M
  \xrightarrow{\enspace \varphi \enspace} N
$$
is exact.
(Original scan)

Let $R$ be a ring with $1$, not necessarily commutative. Let $D, L, M$ and $N$ be $R$-modules. If the sequence
$$
  0
  \longrightarrow \operatorname{Hom}_R(D, L)
  \xrightarrow{\enspace g_* \enspace} \operatorname{Hom}_R(D,M)
  \xrightarrow{\enspace h_* \enspace} \operatorname{Hom}_R(D, N)
$$
is exact for all $R$-modules $D$, then $0 \to L \xrightarrow{g} M \xrightarrow{h} N$ is exact.
First observation is that since $R$ is not commutative, $\operatorname{Hom}_R(D, L)$ is generally not an $R$-module. So in general, the exact sequence of the homomorphisms is an exact sequence of abelian groups. But when I saw the proof, it used the fact that when using $R$ as an $R$-module instead of arbitrary $D$, $\operatorname{Hom}_R(R, L)$ is an $R$-module and also $\operatorname{Hom}_R(D, L) \cong L$ as $R$-module isomorphism. This part is clear to me.
My question is the following: If we consider $0 \to L \xrightarrow{g} M \xrightarrow{h} N$ to be an exact sequence of only the underlying structure of abelian groups, I understand why the theorem is true, but if the consequence is an exact sequence of modules, I don’t see how this result is true. I don’t see a straightforward way to convert $g_*$ from a group homomorphism into an $R$-module homomorphism  $\operatorname{Hom}_R(R, L) \to \operatorname{Hom}_R(R, M)$.
Edit: I need to be clearer about my question. My question is, for whoever is familiar with the theorem, what is the formulation of the theorem? Do we talk about the latter exact sequence as a sequence of modules or a sequence of groups? If it is a sequence of modules, then how can I prove it?
 A: First we offer clarification on the statement of the theorem.
Suppose that $R$ is a (not necessarily commutative) associative ring $L, M, N\in R-\text{mod}$ (left $R$-modules, as without commutativity we must pick a side), and further suppose that $g:L\to M$ and $h:M\to N$ are $R$-module homomorphisms. For any $R$-module $D$, we have a functor $\hom_R(D,-):R-\text{mod}\to \mathbb Z-\text{mod}$, defined on morphisms by composition: if $g:L\to M$, then $g_*:\hom_R(D,L)\to \hom_R(D,M)$ is defined by $g_*(f)=g\circ f$.
It is not too difficult to show that if $0\stackrel{}{\longrightarrow} L\stackrel{g}{\longrightarrow} M\stackrel{h}{\longrightarrow} N$ is a left exact sequence, then $0\longrightarrow \hom_R(D,L)\stackrel{g_*}{\longrightarrow} \hom_R(D,M)\stackrel{h_*}{\longrightarrow} \hom_R(D,N)$ is also left exact.
The theorem is the converse of this statement.  If $L, M, N, g, h$ are all given, and if for every choice of $D$ the sequence $0\longrightarrow \hom_R(D,L)\stackrel{g_*}{\longrightarrow} \hom_R(D,M)\stackrel{h_*}{\longrightarrow} \hom_R(D,N)$ is left exact, then $0\stackrel{}{\longrightarrow} L\stackrel{g}{\longrightarrow} M\stackrel{h}{\longrightarrow} N$ is left exact.
There is NOTHING to prove about things being maps of $R$-modules, because things are assumed to be maps of $R$-modules.  The only things to prove are about exactness.
There isn't much to prove here, because you can simply take $D=R$, and there is a cannonical isomorphism $\hom_R(R,M)\cong M$ $f\mapsto f(1)$.  There is a corresponding theorem with the contravariant functors $\hom_R(-,D)$ which is more interesting.

However, it is worth spending a bit of time generalizing the fact that when $D=R$, we are getting not just abelian groups but $R$ modules.
Suppose that $D$ is an $(R,S)$-module (left $R$-module, right $S$-module, and the two structures commute with each other, i.e., $(rd)s=r(ds)$), then the hom-sets will carry more structure and the induced morphisms will be compatible with that structure.
If $D\in (R,S)-\text{mod}$ and $M\in R-\text{mod}$, then we can define multiplication $s\cdot f$ on $f\in \hom_R(D,M)$ by $(s\cdot f)(d)=f(ds)$.  Then $[(st)\cdot f](d)=f(dst)$ while $[s\cdot (t\cdot f)](d)=(t\cdot f)(ds)=f(dst)$
If $M$ and $N$ are $R$-modules and $g:M\to N$ is an $R$-module homomorphism, then the induced map is a map of $S$-modules.  We need to verify $g_*(s\cdot f)=s\cdot (g_*(f))$.  For every $d\in D$ we can evaluate and then unravel the definitions.  $g_*(s\cdot f)(d)=g\circ (s\cdot f)(d)=g(f(ds))=s\cdot (g(f(d))=[s\cdot (g_*(f))](d)$.

It is also worth remarking that if the map is not a map of $R$-modules, then the induced map will not exist (or rather, will not go between the required spaces).  Let $M, N\in R-\text{mod}$, and $g:M\to N$ be a map of abelain groups which is NOT a map of $R$-modules, so that there exists $m, r$ such that $g(rm)\neq rg(m)$.  If $f\in \hom_R(D,M)$, then $g\circ f$ will not in general be an $R$-module homomorphism.  Suppose that $f(d)=m$. Then $$r(g_*(f))(d)=r[(g\circ f) (d)]=r(g(f(d)))=r(g(m))\neq g(rm)=g(rf(d))=[g_*(rf)](d).$$
A: Let $M,N,P$ be $R$-modules ($R$ unital, but necessariliy commutative) then $\hom_R(M,N)$ is a priori only an abeliean group (=$\mathbb{Z}$-module). I will provide a (partial) proof of your claim, namely that
$$0\to M \xrightarrow{f} N \xrightarrow{g} P \tag{1}$$
is exact iff for all $R$-modules $D$ the sequence
$$0\to \hom_R(D,M) \xrightarrow{f_*} \hom_R(D,N)\xrightarrow{g_*} \hom_R(D,P)\tag{2}$$
is exact.
Assume (1). First we'll show that $f_*$ is injective. We have that
$$\ker(f_*)=\ker(\hom_R(D,M)\to \hom_R(D,N))\cong\hom_R(D,\ker(M\to N))=0$$
(the isomorphism can either be computed directly or can be seen abstractly because the functor $\hom_R(D,-)$ commutes with arbitrary limits). As $g\circ f=0$ we have $g_* \circ f_* =0$, so $\operatorname{im} f_* \subset \ker g_*$ by functoriality of $\hom_R(D,-)$. Let $h\in \ker(g_*)\subset \hom_R(D,N)$, i.e. $g\circ h=0$, so for all $d\in D$ we have $h(d)\in \ker g=\operatorname{im}f$; pick $m_d\in M : f(m_d)=h(d)$ for $d\in D$ and define $\phi:D\to M, d\mapsto \phi(d):= m_d$. As $f$ is injective the $m_d$'s are unique. We claim that $\phi$ is $R$-linear. Indeed, let $\mu\in R, d,d'\in D$. By construction and $R$-linearity of $f$ and $h$ we get:
$$f(\phi(d+\mu d'))=h(d+\mu d')=h(d)+\mu h(d')=f(\phi(d)+\mu \phi(d')),$$
whence $\phi(d+\mu d')=\phi(d)+\mu \phi(d')$, since $f$ is injective.
Assume (2). Take $D=R$ in (2). This yields (1).
