
Help with a basic proof
Prove that, if f:A>B and g:B>C are functions with gof:A>C bijective, then f is injective and g is surjective.
Now, I easily saw how g is surjective:
Let x be an element of A
Since gof:A>C is bijective, g(f(x)) is bijective
Implies g(f(x)) is surjective and g(f(x)) is injective
Thus g is surjective.
But I've been fumbling around with trying to show that f is injective and I get lost. I'm sure it's something stupid I'm missing. Can anyone start me off in the right direction?

Proving that f is injective is the easy part.
Suppose that f(a)= f(b) then by definition g(f(a))= g(f(b)).
But gof is bijective so gof(a)= gof(b) implies that a=b.