TITLE: Is there any difference between mapping and function?
QUESTION [96 upvotes]: I wonder if there is any difference between mapping and a function. Somebody told me that the only difference is that mapping can be from any set to any set, but function must be from $\mathbb R$ to $\mathbb R$. But I am not ok with this answer. I need a simple way to explain the differences between mapping and function to a lay man together with some illustration (if possible).
Thanks for any help.

REPLY [11 votes]: To me, function and map mean two entirely different things. A function is just a set-theoretic construction, something that assigns to each object in a set some unique object of another set. A map, on the other hand, is a construction from category theory rather than set theory. It means more or less the same thing as morphism: a function that preserves the structure in whatever category we are working in. So a map is not just a map, it is a map of something:

A map of groups or rings is a homomorphism
A map of vector spaces is a linear function
A map of topological spaces is a continuous function
A map of smooth manifolds is a smooth function
A map of measurable spaces is a measurable function
A map of varieties is a morphism
A map of sets is any function

Note that I deliberately avoided the term “map” in the predicates here. That is because the “map” parts of terms like “continuous map” and “linear map” are actually redundant; a linear map is really just a map (of vector spaces), and a continuous map is just a map (of topological spaces). Consequently, I avoid many of these redundant terms and simply say “let $f\colon X\to Y$ be a map” when it is clear from the context which category I currently think of $X$ and $Y$ as being objects of. I am particularly pleased to avoid the long and complicated term “homomorphism.”
On the other hand, I use the word “function” when I want to think of it as my object of study rather than a method of carrying structure from one object to another. Thus I would always call members of $\mathscr L^p$ spaces (which is the space of functions rather than the space $L^p$ of equivalence classes of functions) by the word “function,” even though they are measurable and hence can be thought of as maps of measurable spaces. Similarly, I would mostly call elements of polynomial rings or coordinate rings “functions” unless I am interested in some structure they preserve. 
So to sum up: A map is a function preserving some structure, namely the structure of whatever category we are working in. The “function” part is just the underlying set-theoretic object, which is more or less the same thing as a map of sets. (Note, however, that I am well aware that not all people follow this convention.)