Is this a valid proof for the following?
Let $f$ and $g$ be functions such that $f: A \to B$ and $g: B \to C$. Prove or disprove that if $g(f(x))$ is surjective, then $g$ is surjective.
To show that $g$ is onto, it must be shown that for every element $c \in C$, $g(b) = c$ for some $b \in B$. Since we know that $g(f(x))$ is onto, then for every element $c \in C$, $g(f(a)) = c$ for some $a \in A$, which means that for every element $b \in B$, $f(a) = b$ for some $a \in A$.
That is, $g(f(a)) = g(b) = c$.
Therefore, we have shown that $g$ is onto $C$.