Given any finite family of abelian groups $A_1, A_2, ..., A_n$, an endomorphism $f$ of $A_1 \times A_2 \times ... \times A_n$ is determined by a family of homomorphisms $f_{ij}=\pi_i \circ f \circ \iota_j:A_j \to A_i$ for $(i, j) \in \{1, 2, ..., n\} \times \{1, 2, ..., n\}$ (because $A_1 \times A_2 \times ... \times A_n$ is both the product with projections $\pi_i$ and the coproduct of the $A_i$s with injections $\iota_j$ in the category of abelian groups). The projection $\pi_i$ is, of course, given by $(a_1, a_2, ..., a_n) \mapsto a_i$, while the injection $\iota_j$ is given by $a_j \mapsto (0, ..., 0, a_j, 0, ..., 0)$. Such a family could be conveniently organized into an $n \times n$ matrix $\begin{pmatrix} f_{11} & f_{12} & \cdots & f_{1n} \\ f_{21} & f_{22} & \cdots & f_{2n} \\ \vdots & \vdots & \ddots & \vdots \\ f_{n1} & f_{n2} & \cdots & f_{nn} \end{pmatrix}$.
In particular, the endomorphisms $f$ of $\mathbb{Z} \times \mathbb{Z}/2\mathbb{Z}$ can be identified with the matrices $\begin{pmatrix} f_{11} \in \operatorname{Hom}(\mathbb{Z}, \mathbb{Z}) & f_{12} \in \operatorname{Hom}(\mathbb{Z}/2\mathbb{Z}, \mathbb{Z}) \\ f_{21} \in \operatorname{Hom}(\mathbb{Z}, \mathbb{Z}/2\mathbb{Z}) & f_{22} \in \operatorname{Hom}(\mathbb{Z}/2\mathbb{Z}, \mathbb{Z}/2\mathbb{Z}) \end{pmatrix}$, with the first and second columns given by $f(a, 0)$ for $a \in \mathbb{Z}$ and $f(0, b)$ for $b \in \mathbb{Z}/2\mathbb{Z}$ respectively.
Note that $\operatorname{Hom}(\mathbb{Z}/2\mathbb{Z}, \mathbb{Z})$ is trivial, meaning that every matrix of this form is lower triangular.
So, only the other three Hom groups need to be considered. The top left Hom group is isomorphic to $\mathbb{Z}$, while the bottom two Hom groups are both isomorphic to $\mathbb{Z}/2\mathbb{Z}$.
The group of endomorphisms of $\mathbb{Z} \times \mathbb{Z}/2\mathbb{Z}$ is thus isomorphic to $\mathbb{Z} \times \mathbb{Z}/2\mathbb{Z} \times \mathbb{Z}/2\mathbb{Z}$ (often, $\times$ is denoted $\oplus$ instead, but that doesn't matter). Each $(a, b, c) \in \mathbb{Z} \times \mathbb{Z}/2\mathbb{Z} \times \mathbb{Z}/2\mathbb{Z}$ is then identified with the endomorphism $(x, y) \mapsto (ax, bx+cy)$ (or in matrix notation, $\begin{pmatrix} a & 0 \\ b & c \end{pmatrix} \begin{pmatrix} x \\ y \end{pmatrix}=\begin{pmatrix} ax \\ bx+cy \end{pmatrix}$).