The surjectivity is the hard part. Do you know about the characteristic function? defined by
If we must find a function .
Let , that is the complement of in .
Now the claim is that is such a function.
Can you prove that?