Say is injective. Define a function in the following way: let if for then define otherwise define . It is important to show this is well-defined meaning it makes sense how we defined this function. Perhaps there are several values of such that - if so then which one do we choose for ? This is not a problem because the function is injective thus these values of are unique. This defines a function . Now we need to confirm that . And this is of course true on how we defined above.
You try the converse and the second part.