On the inclusion homomorphism $\mathbb Z\to\mathbb Q$
Your argument only shows that if $h\circ i=h’\circ i$, then $h(n)=h’(n)$ for all $n\in\mathbb{Z}$. However, you need to show that $h(q)=h’(q)$ for all $q\in\mathbb{Q}$. In order to do that, you will need to use the multiplicative structure of $\mathbb{Q}$, as this does not follow from just the additive structure (the canonical projection $\pi\colon\mathbb{Q}\to\mathbb{Q}/\mathbb{Z}$ and the zero map $z\colon\mathbb{Q}\to\mathbb{Q}/\mathbb{Z}$ satisfy $\pi\circ i = z\circ i$, but $\pi\neq z$; note that these are group homomorphisms, but not ring homomorphisms). That is, the embedding is not an epimorphism of abelian groups.
To complete the argument and show that it is an epimorphism in the category of rings you need to be careful. If you assume that rings always have a $1$ and that ring homomorphisms map $1$ to $1$, then you can use the fact that under those circumstances, units must be mapped to units and multiplicative inverses to multiplicative inverses (which are unique), so that you will have for every $n\neq 0$, $n\in\mathbb{Z}$ $$h\left(\frac{1}{n}\right) = h(n^{-1}) = h(n)^{-1} = h’(n)^{-1} = h’(n^{-1}) = h’\left(\frac{1}{n}\right)$$ and then conclude that if $p,q\in\mathbb{Z}$, $q\neq 0$, then $$h\left(\frac{p}{q}\right) = h(p)h(q^{-1}) = h’(p)h’(q^{-1}) = h’\left(\frac{p}{q}\right).$$
However, if you do not assume that rings must have a $1$ or that maps between rings must send $1$ to $1$, the claim is still true; you can see a proof using a zigzag in this old answer of mine. Note that the latter proof in fact does not even use the additive structures of $\mathbb{Z}$ and $\mathbb{Q}$; it only concerns the multiplicative structure and multiplicative maps. It is a proof that the embedding is an epimorphism in the category semigroups, where we view both $\mathbb{Z}$ and $\mathbb{Q}$ as multiplicative semigroups.
Suppose $f\colon\mathbb{Q}\to\mathbb{Z}$ is a group homomorphism. For every $n\gt 0$, we have that $\frac{1}{n}$ added to itself $n$ times equals $1$, hence $$f(1) = f\left(\sum_{i=1}^n \frac{1}{n}\right) = \sum_{i=1}^n f\left(\frac{1}{n}\right).$$ If $f(1)=a\in\mathbb{Z}$, then this tells you that for every $n\gt 0$ there exists a $b\in\mathbb{Z}$ (namely, $f(\frac{1}{n})$) such that $nb = a$. (Here, $nb$ means “$b$ added to itself $n$ times”, but this agrees with the usual multiplication of integers). But this means that $a$ is divisible by $n$, and this must hold for all natural numbers $n\gt 0$. The only integer with this property is $0$, so we must have $f(1)=0$. In particular, we cannot have $f(m)=m$ for all $m\in\mathbb{Z}$ if $f$ is an additive map. (In fact, you must have $f(x)=0$ for all $x$, since by the above you conclude that every integer must map to $0$, and hence every rational $\frac{p}{q}$ must map to a $q$-torsion element... and the only such element is $0$).
The inclusion $\mathbb{Z} \hookrightarrow \mathbb{Q}$ is not epic in $\mathbf{Ab}$, but it is epic in $\mathbf{Ring}$ as well as in the category of torsion-free abelian groups.
Also, there is no nonzero homomorphism from $\mathbb{Q}$ to $\mathbb{Z}$, because the image of any rational number would have to be an integer that is divisible by every nonzero integer, and no nonzero integer is divisible by any integer with a larger absolute value.