Proving $[A:B]=[A^f:B^f][A_f:B_f]$ I'm having a hard time showing an equality of indices holds. This is exercise 1.44 from Lang's Algebra.

Suppose $f\colon A\to A'$ is a homomorphism of abelian groups, and $B\leq A$. Denote by $A^f$ and $A_f$ the image and kernel of $f$ in $A$ respectively, and similarly for $B^f$ and $B_f$. Show that $[A:B]=[A^f:B^f][A_f:B_f]$ in the sense that if two of these three indices are finite, so is the third, and the stated equality holds.

My initial thought was to compose a bijection from $A/B$ to $A^f/B^f\times A_f/B_f$. I tried to map a coset $aB$ to $(f(a)B^f,\underline{\hspace{.75cm}})$ but couldn't think of a nice candidate for the right coordinate.
Does anyone have suggestions on the right approach here? Thanks for your input.
 A: This follows from the isomorphism theorems and the fact that for finite groups, $|A/B||B|=|A|$.  
First, note that we have the following useful isomorphisms.  $A^f=A/A_f$, $B^f=B/B_f$, $B_f=B\cap A_f$.  To simplify notation, let $A_f=N$.
We have two sets of maps in the problem: $N\to A \to A/N$ and $N\cap B \to B \to B/(N\cap B)$, where the maps are the natural inclusions and quotient maps.  What we wish to show is that we have maps
$N/(N\cap B)\to A/B \to (A/N)/(B/(N\cap B))$, and that $(A/B)/(N/N\cap B)\cong (A/N)/(B/(N\cap B))$.  However, using the isomorphism theorems, we have
$(A/B)/(N/N\cap B)\cong (A/B)/(N+B/B)\cong A/(N+B)\cong (A/N)/((N+B)/N) \cong  (A/N)/(B/N\cap B)$.
If you trace through the isomorphisms in the isomorphism theorems explicitly, you will see that they give exactly the maps you want them to.
More concretely, because $B_f=A_f\cap B$, the map $A_f/B_f\to A/B$ sending $aB_f$ to $aB$ is injective, and because the map $A\to A^f$ is surjective, the map $A/B\to A^f/B^f$ sending $aB$ to $f(a)f(B)$ is also surjective.  The statement that $aB$ is in the kernel of the second map is equivalent to the statement that $f(a)=f(b)$ for some $b\in B$, or $f(ab^{-1})=e$, hence $aB\in A_f/B=\operatorname{im}(A_f/B_f)$, and hence the image of the first map is equal to the kernel of the second map.
A: Let $P$ be a representant system for cosets of $B^f$ in $A^f$. Let $Q$ be a representant system for cosets of $B_f$ in $A_f$. For every $p\in P$ choose an element $a_p\in A$ such that $f(a_p)=p$. We will prove that the indexed family $(a_p+q)_{(p,q)\in P\times Q}$ is a representant system for cosets of $B$ in $A$.
For $x\in A$ then $f(x)\in A^f$, so there is a $p\in P$ such that $f(x)\in p+B^f$, so $f(x)-f(a_p)\in B^f$, so there is a $b\in B$ such that $f(x)-f(a_p)=f(b)$, so $x-a_p-b\in A_f$, so there is a $q\in Q$ such that $x-a_p-b\in q+B$, so $x\in a_p+q+B$.
Also, if $a_p+q+B=a_{p'}+q'+B$ then $a_p+q-a_{p'}-q'\in B$, so $f(a_p)+f(q)-f(a_{p'})-f(q')\in B^f$, so $p-p'\in B^f$, so $p=p'$, so $q-q'\in B$, but $q-q'\in A_f$, so $q-q'\in B_f$, so $q=q'$.
