Our professor gave us a proof for P.I.D.'s, but I believe I've found a proof that shows it works for any integral domain. If my claim is wrong, could someone explain why my proof fails? Or even just tell me it's wrong. Thank you.
$\textbf{Proof:}$
Let $R$ be an integral domain and $M$ an $R-$module.
$\Rightarrow$ Suppose $M$ is divisble, and
$$\newcommand{\ra}[1]{\kern-1.5ex\xrightarrow{\ \ #1\ \ }\phantom{}\kern-1.5ex} \newcommand{\ras}[1]{\kern-1.5ex\xrightarrow{\ \ \smash{#1}\ \ }\phantom{}\kern-1.5ex} \newcommand{\da}[1]{\bigg\downarrow\raise.5ex\rlap{\scriptstyle#1}} \begin{array}{c} 0&\ra{}&I&\ra{f}& R\\ &&\da{g}\\ && M \end{array}$$
where $I\leq R$, $g$ a homomorphism, and $f$ a monomorphism. Let $s,r\in I\backslash 0.$ Then by divisibility choose $n,m\in M$ such that $$g(s)=sm,\text{ }g(r)=rn.$$ We compute $$g(sr)=sg(r)=srn=rsn$$ $$g(sr)=g(rs)=rg(s)=rsm.$$ By cancellation $m=n.$ Now define $h:R\to M$ a homomorphism by $h(1)=n.$ Then if $$h(s)=sh(1)=sn=g(s),$$ so $h$ extends $g,$ and thanks to our friend Baer we know that $M$ is injective.
$\Leftarrow$ Now suppose that $M$ is injective. Let $m\in M$ and $a\in R\backslash0.$ We set $I=Ra.$ It follows that we have
$$\begin{array}{c} 0&\ra{}&I&\ra{f}& R\\ &&\da{g}\\ && M \end{array},$$
where $f$ is the inclusion map, and $g(ra)=rm.$ Now by the injectiveness of $M$ choose $h:R\to M$ extending $g.$ Then $$m=f(a)=h(a)=ah(1),$$ so $M$ is divisible. This completes the proof. $\blacksquare$