Why is $\operatorname{Hom}_{\mathbb{Z}}(-,\mathbb{Q})$ right exact functor? I'm looking for an example of a ring $R$ and an $R$-module $M$ such that the functor $\operatorname{Hom}_R(-,M)$ is exact.
I've seen that this is equivalent to saying that $M$ is an injective module, so $\mathbb{Q}$ as $\mathbb{Z}$-module should do the trick, as it's divisible. However, we were not introduced to terms like injective module, divisible module etc.
So what I'm trying to show is that, if $f: A \rightarrow B $ is an injective $\mathbb{Z}$-module homomorphism, then  $\forall g \in \operatorname{Hom}_{\mathbb{Z}}(A,\mathbb{Q}), \ \exists \ h \in \operatorname{Hom}_{\mathbb{Z}}(B,\mathbb{Q})$ s.t. $ h \circ f = g $.
However, I fail trying to show that. Is there an somewhat easy way to do so, or is there maybe an easier example than $\mathbb{Q}$, which has the desired property?
 A: Well, you could take $R = F$ to be a field.
Then for any $R$-module $M$, $\text{Hom}(\ \_ \ , M \ )$ is exact: if $V' \subset V$ is an inclusion, then $\text{Hom}(V, M) \twoheadrightarrow \text{Hom}(V', M)$: given a map from $V'$ to $M$, pick a basis for $V'$,  extend it to a basis for $V$, and lift your map by defining it to be zero on the new basis elements. (Note that the axiom of choice is needed even in this simple case).
Once $R$ is not a field, there is not any easier example than $R = \mathbb{Z}$ and $M = \mathbb{Q}$. Two pieces of good news about the definitions you haven't encountered yet: the word injective in this context just means exactly that the functor $\text{Hom}(\ \_ \ , M \ )$ is exact, and the word divisible refers to an extremely concrete property of abelian groups. Probably the best next step is to learn about divisible groups and Baer's criterion.
A: As @AnginaSeng says in the comments, you should prove this with a Zorn's Lemma argument (indeed, I believe it's impossible to show that this functor is exact without some kind of choice). To simplify things a little bit, suppose $A$ is a submodule of $B$ and let $g : A \to \mathbb{Q}$ be arbitrary. We need to show that there exists some $h : B \to \mathbb{Q}$ such that $h|_A = g$ (this is exactly the same as the setup you gave, up to isomorphism of the diagram).
Let
$$P = \{(S,\sigma) : A \leq S \leq B~\text{and}~\sigma : S \to \mathbb{Q}~\text{is a homomorphism such that}~\sigma|_A=g\}$$
where $\leq$ means "submodule of". Define the relation $\preceq$ on $P$ by $(S,\sigma) \preceq (T,\tau)$ iff $S \subseteq T$ and $\tau|_S = \sigma$. It's easy to show that $\mathbf{P} = (P,\preceq)$ is a poset, and $P$ is nonempty because $(A,g) \in P$. Moreover, if $\{(S_i, \sigma_i)\}_{i \in I}$ is a nonempty chain in $\mathbf{P}$, it's easy to show that
$$\left(\bigcup_{i \in I} S_i, \bigcup_{i \in I} \sigma_i\right) \in P,$$
so that every nonempty chain in $\mathbf{P}$ has an upper bound (here we think of functions as sets of ordered pairs so that $\bigcup_i \sigma_i$ makes sense). By Zorn's Lemma, $\mathbf{P}$ has some maximal element $(M,m)$.
Suppose for contradiction that $M \neq B$. Pick some $x \in B \setminus M$, and let $M' = M + \mathbb{Z}x$ (in other words $M'$ is the span of $M \cup \{x\}$). We now consider two cases:
Case 1 $M \cap \mathbb{Z}x = \varnothing$. In this case, $M' = M \oplus \mathbb{Z}x$, so we can define a homomorphism $m' : M' \to \mathbb{Q}$ by $m'(a + nx) = m(a)$ for $a \in M, n \in \mathbb{Z}$. Note that  $(M',m') \in P$ and $(M,m) \prec (M',m')$, so this contradicts the maximality of $(M,m)$!
Case 2 $M \cap \mathbb{Z}x \neq \varnothing$. Then $\{n \in \mathbb{N} \setminus \{0\} : nx \in M\}$ is nonempty; by the well-ordering principle it contains a least element $n_0$. Now let $m' : M' \to \mathbb{Q}$ be defined by
$$m'(a + nx) = m(a) + \frac{n}{n_0}m(n_0x)$$
for $a \in M, n \in \mathbb{Z}$. Prove that $m'$ is well-defined and that $(M',m') \in P$; but again this contradicts the maximality of $(M,m)$!
Since both cases resulted in a contradiction, we conclude that $M = B$, and therefore $m$ is a valid choice for the desired map $h$.
As a side note, the exact same argument shows that the fraction field of $R$ is an injective $R$-module for any integral domain $R$!
A: Maybe I am just tired, but I believe that for the special case $\operatorname{Hom}_{\mathbb{Z}}(.,\mathbb{Q})$ there is a simpler argument relying on the fact that $\mathbb{Q}$ is flat.
Indeed, if $0\to A\to B\to C\to 0$ is exact, then by flatness, so is $0\to A\otimes\mathbb{Q}\to B\otimes\mathbb{Q}\to C\otimes\mathbb{Q}\to 0$. But then we have the commutative diagram :
$$\require{AMScd}
\begin{CD}
0@>>>\operatorname{Hom}_{\mathbb{Z}}(C,\mathbb{Q})@>>>\operatorname{Hom}_{\mathbb{Z}}(B,\mathbb{Q})@>>>\operatorname{Hom}_{\mathbb{Z}}(A,\mathbb{Q})@>>>0\\
@.@|@|@|\\
0@>>>\operatorname{Hom}_{\mathbb{Q}}(C\otimes\mathbb{Q},\mathbb{Q})@>>>\operatorname{Hom}_{\mathbb{Q}}(B\otimes\mathbb{Q},\mathbb{Q})@>>>\operatorname{Hom}_{\mathbb{Q}}(A\otimes\mathbb{Q},\mathbb{Q})@>>>0
\end{CD}
$$
The equality between the top and bottom row follows from the extension-restriction of scalar adjunction. The bottom row is exact because $\mathbb{Q}$ is a field. It follows that the top row is exact, hence $\operatorname{Hom}_{\mathbb{Z}}(.,\mathbb{Q})$ is exact.

Using the other characterisation : let $A\to B$ be an injection between abelian groups and $g:A\to\mathbb{Q}$ be any morphism. We want to extend $g$ to a morphism $h:B\to\mathbb{Q}$. First, note that we can extend $g$ to a morphism $\tilde{g}:A\otimes \mathbb{Q}\to\mathbb{Q}$ by letting $\tilde{g}(a\otimes r)=rg(a)$ and $\tilde{g}$ is $\mathbb{Q}$-linear. Let $(a_i)$ a $\mathbb{Q}$-basis of $A\otimes\mathbb{Q}$, by flatness the family $(a_i)$ is still free in $B$ and we might complete it to a basis $(a_i),(b_j)$ of $B\otimes\mathbb{Q}$. Now define $h:B\otimes\mathbb{Q}\to\mathbb{Q}$ by letting $\tilde{h}(a_i)=\tilde{g}(a_i)$ and $\tilde{h}(b_j)=0$. Finally, let $h:B\to\mathbb{Q}$ be the composition $B\to B\otimes\mathbb{Q}\xrightarrow{\tilde{h}}\mathbb{Q}$
