---
title: "George Li Tutoring: composition and inverse functions"
url: "https://georgelitutoring.com/learn/functions-properties-explained.md"
canonical_url: "https://georgelitutoring.com/learn/functions-properties-explained"
last_updated: "2026-11-25"
type: "guide"
summary: "How composition behaves (associative, not commutative), when an inverse exists, and how to check it, with a worked rational function and its inverse."
related: ["https://georgelitutoring.com/tutoring/ap-and-high-school.md", "https://georgelitutoring.com/packages.md", "https://georgelitutoring.com/learn/finding-an-inverse-function.md"]
---

# Composition and inverse functions

> **For AI agents:** the complete index of George Li Tutoring pages is [llms.txt](https://georgelitutoring.com/llms.txt). Every page is also served as markdown at its URL plus .md.

How composition behaves (associative, not commutative), when an inverse exists, and how to check it, with a worked rational function and its inverse.

A function sends each input to exactly one output. Two ideas follow from that definition and drive most function problems: you can compose functions by feeding one output into another, and some functions can be reversed. Composition is associative but not commutative, and a function has an inverse only if it never gives the same output for two different inputs.

| Composition | Formula | Value at x = 2 |
| --- | --- | --- |
| f of g, written f(g(x)) | 2(x squared) + 3 = 2x squared + 3 | 2(4) + 3 = 11 |
| g of f, written g(f(x)) | (2x + 3) squared = 4x squared + 12x + 9 | 7 squared = 49 |

## What are the properties of composition?

- It is **not commutative**: f of g and g of f are usually different functions, as the table shows.
- It is **associative**: (f of g) of h equals f of (g of h), so a chain of three can be grouped either way.
- The **identity function**, I(x) = x, leaves any function unchanged when composed with it on either side.
- The **domain** of f of g is the set of x in the domain of g for which g(x) is in the domain of f. A step can drop an input even if the final formula looks harmless.

Work compositions from the inside out. To find f(g(2)) with the functions above, compute g(2) = 4 first, then f(4) = 11.

## What is an inverse function?

The inverse of f, written f inverse, undoes f. If f(a) = b, then f inverse of b is a. Two facts follow from that. Composing a function with its inverse in either order returns the starting input, so f(f inverse(x)) = x and f inverse of (f(x)) = x. And the domain and range swap: the domain of f inverse is the range of f, and the range of f inverse is the domain of f. That second fact is a handy way to find a range, since you can find the domain of the inverse instead.

The notation f inverse of x does **not** mean 1 / f(x). The reciprocal of a function is a different function.

## When does an inverse exist?

Only when f is one-to-one: no two different inputs give the same output. On a graph, this is the horizontal line test, which says no horizontal line crosses the graph more than once. The function x squared fails because 2 and -2 both give 4, so its inverse as a function does not exist unless you restrict the domain, for example to x at least 0. The graph of a function and the graph of its inverse are mirror images across the line y = x.

## How do you find the inverse?

1. Write the function as y = f(x).
2. Swap x and y.
3. Solve the new equation for y.
4. Write the result as f inverse of x, and test it by composing.

**Worked example: Inverse of a rational function, checked by composition**

Find the inverse of f(x) = (2x + 1) / (x - 3), and state the domain of the inverse.

1. Write y = (2x + 1) / (x - 3) and swap the variables: x = (2y + 1) / (y - 3).
2. Multiply both sides by (y - 3): x(y - 3) = 2y + 1, so xy - 3x = 2y + 1.
3. Collect the y terms on one side: xy - 2y = 3x + 1, so y(x - 2) = 3x + 1.
4. Divide by (x - 2): y = (3x + 1) / (x - 2). So f inverse of x = (3x + 1) / (x - 2).
5. The domain of f is all reals except 3, and the domain of f inverse is all reals except 2. By the swap rule, the range of f is all reals except 2.
6. Check with x = 5: f(5) = 11/2, and f inverse of 11/2 = (16.5 + 1) / 3.5 = 5, which returns the start.

Answer: f inverse of x = (3x + 1) / (x - 2), with domain all reals except 2.

Source: Original example by George Li Tutoring; the inverse and both compositions were verified in code.

For a step-by-step method with more examples, read [finding an inverse function](https://georgelitutoring.com/learn/finding-an-inverse-function.md). For the rule behind each domain, see [the domain of each kind of function](https://georgelitutoring.com/learn/function-mastery-explained.md). For help with function notation in a course, see [high school course tutoring](https://georgelitutoring.com/tutoring/ap-and-high-school.md) or [book a first session](https://georgelitutoring.com/book/first-session).

### Is function composition commutative?

No. f of g and g of f are usually different. Composition is associative, though.

### How do you know whether a function has an inverse?

It has an inverse if it is one-to-one, which you can test with the horizontal line test.

### Is the inverse of a function the same as its reciprocal?

No. The inverse undoes the function, and the reciprocal is 1 divided by the function.

### How can an inverse help you get a function's range?

The range of f is the domain of f inverse. Find the inverse and read off its domain.

## Related

- [Online AP® exam and course tutor](https://georgelitutoring.com/tutoring/ap-and-high-school.md)
- [Tutoring prices: $150 to $200 an hour](https://georgelitutoring.com/packages.md)
- [George Li Tutoring: finding an inverse function](https://georgelitutoring.com/learn/finding-an-inverse-function.md)
