It is given that

(1) f: A --> B is injective iff f has a left inverse. (f has a left inverse if there is a function g: B --> A such that g(f(a)) = a for all a in A)

(2) f is surjective iff f has a right inverse. (f has a right inverse if there is a function g: B --> A such that f(g(b)) = b for all b in B)

I need to prove that

f is a bijection iff there exists g: B --> A such that f(g(b)) = b for every b in B and g(f(a)) = a for every a in A.

So if I am given (1) and (2) above, can I prove it like this?

i. Suppose f is bijective. That is, f is injective and surjective. Then by (1) there is a function g: B --> A such that g(f(a)) = a for every a in A since f is injective, and by (2) f(g(b)) = b for every b in B. Thus, g is the inverse of f.

ii. Suppose f has an inverse g: B --> A such that f(g(b)) = b for every b in B and g(f(a)) = a for every a in A. Then by (1) and (2) f is injective and surjective. Therefore, f is bijective.

Will this work?