A function is a relation that associates each element x of a set X, to a single element y of another set Y.
Look at the picture.