For the following two questions, I need some help with proofs. I think I have the first one figured out, but I would like to check my result. But I am not sure where to go next with the second proof.
For the first proof I have the following:
Let $y \in B$. Then, by the definition of surjective, there exists an element $x$ in $A$ such that $f(x)=y$. But, since $g \circ f = h \circ f$, we know that $g(y)=g(f(y))=h(f(y))=h(y).$ So, $g(x)=h(x)$ and so $g=h$.
As for the second proof, I think I want to let some arbitrary element $z$ exist in $D$, and then use the definition of injective, which states that $x_{1}=x_{2}$ whenever $g(x_{1})=g(x_{2})$. But I am not sure where to go next. Thank you in advance!
