If f:A→B is 1-1 and im f=B prove that (f^-1 ○f)(a)=a for all a element of A and (f^-1 ○f)(b)=b for each b an element of B.

Here is what I've got out of this.

f is 1-1, so for each b, there is one and only a. So

Im f=b. Thus, f is onto. Therefore, the range is equal to the set B. Would this imply f(a)=b and f(b)=b?

I'm just not sure where to go with this problem.