Inverse of a function.

Recall that every real number a has an additive inverse -a that added with it sums to 0, the additive identity:    a + -a = 0
And that every real number a (except 0) has a multiplicative inverse 1/a (AKA its reciprocal) that multiplied with it equals 1, the multiplicative identity:    a · 1/a = 1
A function ƒ might have an inverse function ƒ-1 that composed with it equals the identity function ƒ(x)=x:     ƒ ∘ ƒ-1 = I(x)

The inverse of a function is a function that "reverses" or "undoes" , rollsback, unwinds, what the function does. It's a kind of "opposite" of the function.
It's the un-function, the de-function, anti-function, counter-function.
ƒ takes x to y, the inverse of ƒ takes y to x.

The inverse of a function ƒ is usually denoted ƒ-1 (this is not an exponent and does not mean reciprocation.)

Example: the cube root function ∛x is the inverse of the cubing function x3. Taking the cube root of a number x that has been cubed "undoes" the cubing, leaving you back where you started. And vice versa, the cubing function is the inverse of the cube root function.
Simplest example? 2x doubles the argument. Its inverse is the function that halves its argument: ½ x. And vice versa, the halving function will be "undone" by the doubling function.
Simplester example? x+1 adds one to the argument. Its inverse subtracts one from its argument: x-1. Or, going the other way, first subtract 1, then add 1 leaves you where you started.
2x-3 first multiplies its argument by 2, then subtracts 3. "Undo" this function by first adding 3, then dividing by 2: (x+3)/2
To manually/mentally find the inverse, do the opposite operations in reverse order.

Having an inverse is a feature of some, not all, functions; only some functions can be "reversed"; see below for what determines whether a function has an inverse or not, and if it does, how to find it.
Non-example: f(x)=x2 is a function that can not be "undone" or "reversed" because for any (positive) number there are two square roots of it, so which is it?

The inverse of a function ƒ is usually denoted ƒ-1 (this is not an exponent and does not mean reciprocation.)

If y=ƒ(x) and ƒ has an inverse, then x=ƒ-1(y)

Applying the inverse function to the output of the function (i.e. composing the function with its inverse) yields the original x value:
   ƒ-1(ƒ(x)) = x    and    ƒ(ƒ-1(x)) = x
Another way to denote this is, using g for the inverse of ƒ:
g(ƒ(x))=x and ƒ(g(x))=x
Or, as ƒ(x)=y, g(y)=x.
Another way to denote this is: (ƒ-1 ∘ ƒ)(x) = x and (ƒ ∘ ƒ-1)(x) = x
This happens with every x in the domain of ƒ.
This also means that a function composed with its inverse yields the identity function:
   ƒ-1 ∘ ƒ = ƒ ∘ ƒ-1 = id(x).
The composition of a function with its inverse “cancels out” the effect of the function.

The range of ƒ is the domain of its inverse ƒ-1. And the domain of ƒ is the range of ƒ-1:

If a function has an inverse, it is unique, i.e. a function can have only one inverse. And the inverse of the inverse is this function, i.e. each is the inverse of the other, and no other. The inverses are a pair of functions.

To have an inverse, a function must pass the horizontal line test: no horizontal line can touch the function's graph more than once.
This means the function must be strictly (monotonically) increasing or decreasing, i.e. always rising or always falling, never changes from increasing to decreasing or vice versa (i.e. has no "turning points"), and never is horizontal for more than one point, which puts a big restriction on the number of functions that have an inverse, but see below for some examples.
This also means the function is one-to-one (1-1, or injective), i.e. each y value in its range is the function value of exactly one x value in its domain.
Example: ƒ(x)=x2 is not 1-1, doesn't pass the horizontal line test, is not strictly increasing or decreasing, and does not have an inverse.
Example: ƒ(x)=x3 is 1-1, passes the horizontal line test, is strictly increasing, and has an inverse.
Example: ƒ(x)=-2x+3 is 1-1, passes the horizontal line test, is strictly decreasing, and has an inverse.
Some strictly monotonic, 1-1, invertible functions: linear mx+b, odd power xodd, logarithm, exponential, logistic, sinh, arctan, root.

A pair of inverse functions: both are strictly increasing or both are strictly decreasing.

Given the y=ƒ(x) formula for a function, with ƒ(x) an expression in x, to find its inverse, interchange (swap) the variables and then solve for y.

Example:
f(x)= 3x
y=3x
x=3y   Swap x and y
y=x/3  Solve for y 
f-1(x)= x/3

Example:
f(x)= -2x+3
y=-2x+3
x=-2y+3   Swap x and y
y=-x/2+3/2  Solve for y
f-1(x)= -x/2 + 3/2

Example:
f(x)= x3+2
y=x3+2
x=y3+2   Swap x and y
y3=x-2   Solve for y
y= ∛(x-2)
f-1(x)= ∛(x-2)
Note that when the expression contains only one x it is easy to reverse the operations manually.
Ex: (x2-2)1/3 1.) square 2.) subtract 2 3.) cube root. [x≥0]
reverses as 1.) cube 2.) add 2 3.) square root: √(x3+2). [x≥-1]

Inverse functions are reflections of each other across (i.e. are symmetric about) the main diagonal y=x, the graph of the identity function.
If a point (a,b) is on the graph of ƒ, then (b,a) is on the graph of ƒ-1.
Same as:
If a point (a,f(a)) is on the graph of ƒ, then (f(a),a) is on the graph of ƒ-1.

Examples


Cube root composed with cube:
Cube composed with cube root:
Both = x.

Every (non-constant) linear function has an inverse. The inverse of a linear function y=mx+b is y = (1/m)x - b/m, another linear function. Note the slopes are reciprocals of each other (and they have the same sign).
A linear function and its inverse intersect on the main diagonal y=x at the point with x and y coordinates of b/(1-m). One function's x-intercept is the other's y-intercept, and its y-intercept is the other's x-intercept. I.e. they exchange intercepts.

Odd power function and that oddth root of x are inverses: xodd and odd√x

x2 does not have an inverse, but with a domain restricted to non-negative numbers it does.

x to an even power and that eventh root of x with domain ≥0 are inverses: xeven and even√x, x≥0

Every odd-degree polynomial function with no even-degreed terms (i.e. has no "wiggle") [?and all/most? terms have same sign (+ or -)] has an inverse. E.g. see below: ƒ(x)=x3+x
Even-degree polynomial functions are not invertible.

Rational functions that are the ratio of two linear polynomials are invertible: (ax+b)/(cx+d) has inverse (-dx+b)/(cx-a). Note that the a and d negatively swap.
Various other rational functions have inverses.

Even functions (symmetric across the y-axis) do not have inverses.

The most famous and important pair of inverse functions are the exponential function and the natural logarithm function.

ln(exp(x))=x and exp(ln(x))=x

Each exponential function bx has logb x as its inverse, and vice versa.

General exponential function: a·bkx + c has inverse 1/k logb((x-c)/a)
The exponential has a horizontal asymptote, its inverse has a vertical asymptote.

A function can be its own inverse.
1/x is such an function. The reciprocal of the reciprocal of x is x.

ƒ(x)=x and ƒ(x)=-x are also self-inverses.
ƒ(x)=(x+1)/(x-1)
The quarter-circle-in-quadrant-I function: ƒ(x)=√(r2-x2)

The graph of a self-inverse function is symmetric about y=x.

NB. Sometimes it's not easy to find the inverse of a function and/or the inverse is complicated.
ƒ(x)=x3+x has inverse:


WolframAlpha: solve for y: ...

sinh(x)= (ex-e-x)/2      arsinh(x)= ln(x+√(x2+1))

Logistic function: 1/(1+e-x)      inverse: -ln((1-x)/x))


The trigonometric functions on restricted domains give rise to the inverse trigonometric functions: the arcsin, arccos, arctan functons. AKA sin-1, cos-1, tan-1 AKA asin, acos, atan

NB. arctan is defined for all Real numbers. It has horizontal asymptotes at ±π/2.

Uses:
Right triangle: If trigFunc(angle)=sideA/sideB then angle = arc-trigFunc(sideA/sideB).
Vectors: Dot product: If u·v=∥u∥*∥v∥*cos(angle) then angle = arccos(u·v / (∥u∥*∥v∥))
Cross product: If ∥u×y∥=∥u∥*∥v∥*sin(angle) then angle = arcsin(∥u×y∥ / (∥u∥*∥v∥))


Distance between two points (a,b) and (b,a) is √2|a-b|.
Line between them is y=-x+(a+b)


The inverse of a n-by-n matrix M is another n-by-n matrix M-1 which when matrix-multiplied together MM-1 = M-1M = In, the identity matrix.