Let $A$ be a finitely generated abelian group and $\alpha:A\to A$ be an endomorphism. Since $A=A_{free}\oplus A_{torsion}$, we can induce $\bar \alpha:A_{free}\to A_{free}$, i.e. $\bar\alpha$ is a map from $\oplus\mathbb Z$ to itself. Write $\bar\alpha$ as a matrix form and define $tr(\alpha)=tr(\bar\alpha)$ as the trace of the matrix.
Assume we have short exact sequence of finitely generated abelian groups $A,B,C$ and endomorphisms $\alpha,\beta,\gamma$ where the following diagram commutes. $$\begin{array}{c} 0 & \to & A & \to & B & \to & C & \to & 0 \\ & & \!\downarrow \alpha && \!\downarrow\beta && \!\downarrow\gamma & \\ 0 & \to & A & \to & B & \to & C & \to & 0\end{array}$$
Prove $tr(\beta)=tr(\alpha)+tr(\gamma)$.
In the case of free abelian groups, the sequence $$ 0 \to A \to B \to C \to 0 $$ splits and we obtain $ B \cong A \oplus C $.
Choosing bases of $A$ and $C$ yields a basis of $B$ and we see (implicitly using above isomorphism) $$ \operatorname{tr} (\beta) = \operatorname{tr}(\beta | A) + \operatorname{tr}(\beta | C)$$ as only diagonal entries are relevent for the trace.
However, $\operatorname{tr}(\alpha) = \operatorname{tr}(\beta|A)$ and $\operatorname{tr}(\gamma) = \operatorname{tr}(\beta | C)$ as the squares in the diagram commute.
For extending to the general case, observe that the free parts of $A, B, C$ form a short exact sequence as well.
A better understanding of trace in this context may be the coordinate-free definition: https://en.wikipedia.org/wiki/Trace_(linear_algebra)#Coordinate-free_definition