Let $A$, $B$, $C$ be sets, and let $f, g, h$ be functions such that: $$ h: A \rightarrow B\\ f: B \rightarrow C\\ g: B \rightarrow C $$
Given that $f \circ h = g \circ h$, prove or disprove that $f=g$ if:
1. $h$ is surjective
2. $h$ is injective
How do I use/incorporate the fact that $h$ is surjective/injective in order to prove that $f=g$?
My attempt at proving (1):
Let $h$ be surjective, therefore for every $b\in B$, there exists $a \in A$ such that $h(a) = b$. Therefore, $f \circ h$ and $g \circ h$ are defined for every $a \in A$.
And given that $f \circ h = g \circ h$, it is true that for every $a \in A \implies f \circ h (a) = g \circ (a)$. Therefore $f = g$.
Edit: My attempt at proving (2):
Let $h$ be injective and not surjective. Therefore there exists $b_1 \in B$ such that for all $a \in A$ $f(a) \neq b_1$. We will define $f$ such that: $f(b_1) = c_1$, and we will define $g$ such that: $g(b_1) = c_2$.
Therefore $f \neq g$.
f and g are mappings with the same domains and codomains. Therefore they are equal iff for all $x$ in $ B$ $f(x)=g(x)$.
Draw a diagram with h as a surjective mapping and realise that the previous equality holds because for any element of $B$ we can always find an element of $A$ that maps to it via $ h $. Use a similiar diagram to find a counterexample in case that $h$ is injective.