Show that $t$ defines a functor $\mathbf{Ab} \to \mathbf{Ab} $ if one defines $t(f)=f \mid_{tG}$ for every homomorphism $f$. 
For an abelian group $G$ let $$tG=\{x \in G \mid x \text{ has a finite order } \}$$ denot its torsion subgroup. Show that $t$ defines a functor $\mathbf{Ab} \to \mathbf{Ab} $ if one defines $t(f)=f \mid_{tG}$ for every homomorphism $f$.

This should follow because

*

*For $f,g \in \operatorname{Hom}(A,B)$ where $A,B \in \operatorname{obj} \mathbf{Ab}$ $$t(f \circ g)=(f\circ g)\mid_{tG} = f \mid_{tG} \circ g \mid_{tG} = t(f) \circ t(g)$$

*$t(1_G)=1\mid_{tG}$
I don't quite understand why $$(f\circ g)\mid_{tG} = f \mid_{tG} \circ g \mid_{tG}$$ where does this come from?
 A: If $\mathscr{C}$ and $\mathscr{D}$ are categories, then a (covariant) functor $T\colon\mathscr{C}\to\mathscr{D}$ is a rule that:

*

*Associates, to every object $A\in\mathrm{Ob}(\mathscr{C})$, an object $T(A)\in\mathrm{Ob}(\mathscr{D})$;

*Associates, to every arrow $f\in\mathscr{C}(A,B)$, an arrow $T(f)\in\mathscr{D}(T(A),T(B))$, for every $A,B\in\mathrm{Ob}(\mathscr{C})$;

*Has the property that if $A,B,C\in\mathrm{Ob}(\mathscr{C})$, $f\in\mathscr{C}(A,B)$, $g\in\mathscr{C}(B,C)$, then $T(g\circ f) = T(g)\circ T(f)$;

*Has the property that if $A\in\mathrm{Ob}(\mathscr{C})$, then $T(\mathrm{id}_A) = \mathrm{id}_{T(A)}$.

Here you have $\mathscr{C}=\mathscr{D}=\mathsf{Ab}$, the category of abelian groups. You are trying to define the functor $T$ by letting $T(A)=tA$, and for $f\colon A\to B$, letting $T(f)=f|_{tA}$.
It is clear that the definition satisfies 1.
In order to verify that it satisfies (2), you need to show that if $f\colon A\to B$ is a morphism of abelian groups, then $T(f)$ will be a morphism from $T(A)$ to $T(B)$; that is, you need to verify that if $a\in tA$, then $f(a)\in tB$. Otherwise, what you get is merely an arrow $f|_{tA}\colon tA\to B$, which is not what you need for a functor: the functor requires that $T(f)$ be a map from $T(A)$ to $T(B)$, not merely from $T(A)$ to something in $\mathrm{Ob}(\mathscr{D})$.
So you need to verify that a morphism $f\colon A\to B$ of abelian groups must map $tA$ into $tB$ for this association to satisfy 2. That is, this is required to even be sure that you are defining something that could be a functor. This is at the level of making sure that your association sends arrows $\mathrm{Hom}(A,B)$ into arrows in $\mathrm{Hom}(tA,tB)$.
Your item (1) is not correctly written: if $f$ and $g$ are both morphisms from $A$ to $B$, then you cannot compose them unless $A=B$ (composition in categories is only defined when the codomain of the first function equals the domain of the second function), so it makes no sense to talk about $f\circ g$ at all. Rather, you need to show that if $A,B,C$ are abelian groups, $f\colon A\to B$ and $g\colon B\to C$ are morphisms, then $(g\circ f)|_{tA} = (g|_{tB})\circ(f|_{tA})$.
And of course you need to verify that $(\mathrm{id}_A)|_{tA} = \mathrm{id}_{tA}$.
