From MathWorld, a function is an object such that every is uniquely associated with an object . Stated more pedantically, if and , then . More colloquially, in the graphs that ordinarily appear in secondary school, every coordinate of the graph is associated with a unique coordinate.
For this reason, the figure below (taken from http://en.wikipedia.org/wiki/Vertical_line_test) is not a function. The three points share a common coordinate but have different coordinates. In school, we usually teach students to distinguish functions from non-functions by the Vertical Line Test.
It is possible for a function to be a function but not have an inverse. Also from MathWorld, a function is said to be an injection (or, in the lingo that I learned as a student, one-to-one) if, whenever , it must be the case that . Equivalently, implies . In other words, is an injection if it maps distinct objects to distinct objects.
The following image (taken from http://en.wikipedia.org/wiki/Horizontal_line_test) illustrates a function that is not injective (or, more accurately, is not injective when using all of the function’s domain). The horizontal line intersects the graph of the function at three distinct points with three different intercepts which are associated with the same -coordinate.
By ensuring that the range of is restricted to the values that are actually attained by , the function may be considered as bijective and hence has an inverse function. The inverse function is logically defined as
In this way, and for all in the domain of and all in the range of . Becaise is on the graph of if and only if is on the graph of , the graph of may be obtained by reflecting the graph of through the line . Stated another way, to ensure that is a function that satisfies the horizontal line test, it must be the case (when looking at the reflection through that the original function satisfies the horizontal line test.