Question: Suppose that $g: X \to Y$ and $h: Y \to Z$ and $f: Y \to Z$ are functions so that $h \circ g = f \circ g$ and $g$ is surjective. Prove that $h = f$.
Comments:
Still trying to wrap this around my head… So basically the map should go: $$ X \to Y \to Z $$
$g$ is the step (function) of $X \to Y$.
$h$ and $f$ are the step (function) of $Y \to Z$.
In some ways I ignore $Y$ since it is an intermediate step and assume that elements of $Y$ such as $h \in Y$ and $f \in Y$ are equivalent to $X$. This should mean that $h$ and $f$ are logically equivalent to $g(X)$ where $g \in X$.
However, $h \circ g$ map would be $Y \to Z \to X \to Y$? But simplifying this should give $Z \to X$ because $Y$ comes from $X$ (I believe not sure). In the other case, $f \circ g$ map would be $Y \to Z \to X \to Y$? $g$ is surjective.
I know there’s something different between $h$ and $f$ but how does surjectivity make them not equal to each other and prove $h = f$? Both functions have the same $Y \to Z$ pattern where the $Y$ comes from the same $X$ (right?). It has something to do with surjectivity changing the property?
I know that surjectivity means: A function $f: A \to B$ is surjective iff $\forall b \in B \exists a \in A$ such that $f(a) = b$.
“Every $b \in B$ is a value of $f$.”
How does this make $h = f $illogical and not equal to each other?
I know that $h$ and $f$ can't be equal since each one has different domains and co-domains.
Any idea for explaining this and helping wrap up my thoughts on this problem would be highly appreciated. I've thought about this problem for a while and can't just seem to connect the dots between the map and $g$ being surjective to show $h = f$ (if possible).