Prove that $\displaystyle A \overset f \longrightarrow B \overset h \longrightarrow C \overset g \longrightarrow D$ is exact iff $f$ is surjective and $g$ injective، where h= 0
I know that it is exact if $\operatorname{im}f=\ker h$ and $\operatorname{im} h = \ker g,$ but I can't prove $f$ is surjective and $g$ injective.