For the particular case of the map $f: \mathbb{Z}\to\mathbb{Z}_2$ you mentioned, the above answer of @diracdeltafunk is nice. I will answer you about the first part.
There are different ways of constructing classifying spaces $BG$. There is a categorical construction of classifying space as follows:
Given a category $\mathscr{C}$ we can get a simplicial set out of it. Define $N\mathscr{C}$ be the simplicial set so that, $(N\mathscr{C})_k$ is the collections of $\{A_0,\cdots,A_k\} \subset \text{Obj}(\mathscr{C})$ such that there is a morphism between $A_i \to A_{i+1}$. The face maps and the degeneracy maps are the natural one. This simplicial set is called Nerve of the category.
There is a natural functor $|\bullet|: \textbf{sSet} \to \text{CW}$ which is called geometric realization of the simplicial set. For the category $\mathscr{C}$ we call $|{N \mathscr{C}}|=: B \mathscr{C}$ the classifying space of the category $\mathscr{C}$.
Let, $G$ be a topological group. Now consider a category $G$ which has only one object and the morphisms are given by elements of group $G$. The classifying space for this category is the classifying space $BG$ we usually deal with. Now for a group morphism $f: G \to H$ we have a functor $f$ from $G\to H$, by the naturality of the construction of Nerve and the geometric realization functor we have a map $Bf: BG\to BH$. This easily gives you a construction for the model $Bf$.
[The above construction is called Bar construction, you can find more explicit description of $Bf$ here.]
Perhaps it's difficult to visualize $Bf$ from the above construction. Here is an alternate construction using principal $G$-bundles and their correspondence. In general it's difficult to see how $Bf$ acts on $BG$ if you don't have a good model. There are some exceptions.
If $H$ is an admissible subgroup of $G$ then we have a SES: $$H\xrightarrow{i}G \xrightarrow{\rho} G/H$$ the related $Bi$ and $B\rho$ are little easier to understand as you can see in the above answer. Also, these $Bi$ gives you some very useful fiber sequences such as : $$G/H \to BH \to BG \\
BH\xrightarrow{Bi}BG \xrightarrow{B\rho} B(G/H)$$