If we define a function #f:{-4,-2,2,7}->{3,5,7}#, such that #f(-4)=5,f(-2)=7,f(2)=3,f(7)=7# then #f# is indeed a function.
We note that #f# is surjective in this case but not injective. Also, we could pick any number set to be the codomain of #f#, but this would make #f# non-surjective.