A function is a mapping from set A to set B, say, which associates a unique element of set B which any element of set A.
If you picture this as a set of lines drawn from the elements of A to those of B, then for a function, you're not allowed to have more than one line emerging from any given element of A.
You are allowed, however, to have more than one line going to any given element of B.
For example, the mapping given by the rule
f(x)=x2 where
x∈R is a function, since no real number has more than one square (e.g. the square of 3 is only 9, and the square of -3 is only 9). Thus, if we drew this mapping using lines between sets, we'd never see two lines emerging from one element of set A (which in this case is
R) and going to different elements in set B (which in this case is also
R).
However,
f(x)=x2 doesn't have an inverse function i.e. a mapping that takes us back from set B to set A, with the necessary property. That's because 9 , for example, as we have seen, is mapped to by both 3 and -3, so it has two lines coming to it. If we try to create a mapping that takes us back from B to A, we can't make it a function (i.e. a mapping with only one line emerging from any element) unless we discard some of the lines.
For example, we could decide to discard all of the lines that take us back to negative elements of set A, so that we'd only have a line from 9 to 3, say. In this case, we would do this by restricting the domain of
f(x) to be the positive real numbers; then the inverse function
f−1(x) would be defined.