Can there be a exact sequence of abelian groups as follows: $$0\to\mathbb{Z}\xrightarrow{g}\mathbb{Z}\oplus\mathbb{Z}\xrightarrow{h}\mathbb{Z}\to\mathbb{Z}\to 0?$$
So I have an error in reasoning: If there is a exact sequence like that, then $\ker(h)\cong \mathbb{Z}$, and $h$ must be the zero map. But then $\ker(h)=\mathbb{Z}\oplus\mathbb{Z}$ which is a contradiction?
If one has an exact sequence of finite length consisting of finitely generated Abelian groups, then the alternating sum of the ranks of the groups is zero. Here this alternating sum is $1-2+1-1=-1$. No such exact sequence can exist.
If you start from the right, then $h$ has to be zero, then the kernel of $h$ is $\Bbb Z\oplus\Bbb Z$ etc.