Determining whether there is a short exact sequence I'm doing some exercises in Hatcher:
Determine whether there is a short exact sequence $  0 \rightarrow \mathbb{Z}_4 \xrightarrow{f} \mathbb{Z}_8 \oplus \mathbb{Z}_2 \xrightarrow{g} \mathbb{Z}_4 \rightarrow 0$. More generally, which abelian groups $A$ fit into a short exact sequence $0 \rightarrow \mathbb{Z}_{p^m} \xrightarrow{f} A \xrightarrow{g} \mathbb{Z}_{p^n} \rightarrow 0 $ where $p$ prime. What about $0 \rightarrow \mathbb{Z} \xrightarrow{f} A \xrightarrow{g} \mathbb{Z}_n \rightarrow 0$.
Can you tell me if this is right:
In the first case, because $f$ injective, it has to map the generator, $1$, to an element of order $4$. There are $2$ essentially different elements of order $4$: $(2,1)$ and $(2,0)$. In both cases I get a contradiction if they are in $ker g$, so there cannot be such an exact sequence.
In the next case, $\mathbb{Z}_{p^m}$ is cyclic, let's say it's generated by $c$. Then $f(c)$ has order $p^m$. So $ker g$ has order $p^m$. Therefore $A$ has to have at least order $p^{n+m}$. Now I'm not sure how to proceed.
Can I deduce anything else about $A$?
Many thanks for your help!
 A: Some hints:
1) If $H$ is the subgroup generated by $(2,1)$, I think that the order of the element $(1,0)+H$ in the quotient group $\mathbf{Z}_8\oplus\mathbf{Z}_2/H$ is four, isn't it?
2) At this point in your studies you're probably expected to be familiar with the structure of finitely generated abelian groups as products of cyclic subgroups. Therefore you should be able to list the possible abelian groups of order $p^{n+m}$. 
3) If $g(a)=1$ and $b=f(1)$, then show that the middle group in your short exact sequence is generated by $a$ and $b$. What kind of restrictions does this place on the group $A$?
============================================
[Added later (Matt accepted, so has solved his problem).] My thinking about the first part of the question could be summarized/generalized as follows. We have an abelian group $G$ of the form $\mathbf{Z}_m\oplus\mathbf{Z}_n$ (w.l.o.g. may assume $n\mid m$). Let $H$ be the subgroup generated by the element $x=(x_1,1)$. Let us consider the quotient group $G/H$. 
A general element $(a,b)\in G$ lies in the same coset modulo $H$ as $(a,b)-bx=(a-bx_1,0)$.
The way I think about is that: we can adjust the latter coordinate to be equal to zero by subtracting a multiple of $x$ from any given element. Furthermore, while doing that we stay within the same coset of $H$. Anyway, this implies that any coset in $G/H$ is a multiple of the coset $(1,0)+H$. In other words, the quotient group $G/H$ is cyclic. Finding its order is easy.  Also observe that the same argument works, if we use $x=(x_1,x_2)$ instead of $(x_1,1)$ as long as $x_2$ is a generator of the latter summand. Here we  should require $gcd(x_2,n)=1$ for that to be the case.
This makes it easy for us to produce short exact sequences of the form
$$
0\rightarrow \mathbf{Z}_{p^m}\rightarrow \mathbf{Z}_{p^j}\oplus\mathbf{Z}_{p^{m+n-j}}\rightarrow\mathbf{Z}_{p^n}\rightarrow 0,
$$
for any $j$ such that $\max\{n,m\}\le j\le m+n$. Simply let the first homomorphism to be the one that sends $1$ to $y=(p^{j-m},1)$. The element $y$ has the correct order, so this mapping is a well-defined monomorphism. The argument above shows that the cokernel must be cyclic, so we are done.
