if X and Y are finite, this is pretty easy, because in that case, both are isomorphic to , where n = |X| = |Y|.
what's not so clear is that this is also true even if X are Y are infinite sets like and .
well, your isomorphism o is going to have to use f somehow, because it's the only mapping X-->Y we're able to get our hands on.
what does an element of look like? well, it in turn, is a bjiection φ: X--->X, x-->φ(x).
so how can we create a mapping ψ:Y-->Y using f? how about defining ψ(f(x)) = f(φ(x)), which takes f(x)-->f(φ(x)).
f is onto, so f(x) runs through all values of y, and the x in f(x) is uniquely defined, because f is injective, so ψ is well-defined.
now, i've done the hard part, all you have to do is show that o:φ -->ψ (that is if φ:x-->φ(x), then o(φ):f(x)-->f(φ(x))
is, in fact, an isomorphism. (you might want to let be two arbitrary elements of ).