Suppose $gf$ is 1-1. Is $g$ 1-1?
Let $g(f(x_0)) = g(f(x_1))$.
Then $x_0 = x_1$.
Then $f(x_0) = f(x_1)$.
So $g$ is 1-1.
Maybe there might not exist an $x_0$ or an $x_1$, but I assume since $gf$ is 1-1, then an $x$ must exist. So I wouldn't need to prove $f$ is onto.