Any advice is greatly appreciated. I wrote this proof but still struggle to understnad it. I am especially worried about the 2nd to last line.
PROOF:
Because $f$ is surjective, for all $b$ in $B$ there exist an $a$ in $A$ such that $f(a)=b$.
Now, $$(g\circ f)(a)=g(f(a))=g(b).$$
Because $g$ is surjective, for all $c$ in $C$ there exist a $b$ in $B$ such that $f(b)=c$.
Therefore, for all $c$ in $C$ there exist an $a$ in $A$ such that $g(f(a))=(g\circ f)(a)=c$.
And so $g\circ f$ is surjective if both $g$ and $f$ are surjectie.
QED
The idea is right. It's not exactly wrong. But things are in the wrong order. As it is, you have basically said:
Here it's obvious enough that that looks sort of like a proof, but the structure is wrong.
You don't want to use the definitions unless you know exactly how they help you. Just re-stating the definitions again isn't useful. Start just with the given hypotheses:
Now think about what you want to prove: "For all $c \in C$, there is $a \in A$ with $(g \circ f)(a) = c$." You aren't there yet, but that's the goal. Since you want to prove a universally quantified statement ("For all $c \in C$..."), you automatically write:
Now you have a thing called $c$ in play and you can refer to it subsequently. You want to prove something about it: "...there is $a \in A$ with $(g \circ f)(a) = c$." You need to get your hands on such $a \in A$ somehow. Now think about the definition you have: "For all $c$ in $C$ there exist a $b$ in $B$ such that $g(b)=c$." But you don't need to state this. We already know it. Just apply it to your $c$ which is already in play:
Now you have a thing called $b$ you can reason about. Next step is obvious:
Now you have your $a$. To finish, prove the thing you need to prove about $a$:
Finally, if you like, give one last sentence saying that you're done:
All together: