Blog

Inverse Functions and Composite Functions: When Does an Inverse Exist?

Learn how composite functions work, when an inverse function exists, and how one-one, onto, domain, and range decide the answer.

  • 12th
  • Study Advice
Transparent function machines carrying colored paths forward and backward beside a funnel where paths merge

Inverse functions and composite functions become much easier when you stop treating them as two separate tricks.

They are really about one simple question:

Can a function’s action be followed clearly, and can it be reversed without confusion?

A composite function follows one function after another. An inverse function walks the path back. But the path can be walked back only if the original function has not merged two different inputs into the same output, and only if every output in the codomain is actually reached.

That is why the words one-one, onto, domain, codomain, and range matter so much in this chapter. They are not decorative definitions. They decide whether the inverse exists at all.

Let us build this idea slowly and clearly.

Start With What a Function Does

A function takes an input and gives exactly one output.

If f(x) = 2x + 3, then:

f(1) = 2(1) + 3 = 5
f(4) = 2(4) + 3 = 11

So the function is doing this:

input -> rule -> output

For f(x) = 2x + 3, the rule is:

multiply by 2, then add 3

Now think about reversing it.

If the output is 11, can we find the input?

2x + 3 = 11
2x = 8
x = 4

Yes. The path can be reversed.

But this is not true for every function.

If f(x) = x^2, then:

f(2) = 4
f(-2) = 4

The two different inputs 2 and -2 have reached the same output. If someone only tells you the output is 4, you cannot know whether the original input was 2 or -2.

That is the first warning sign.

What a Composite Function Means

A composite function means one function is applied after another.

Suppose:

f(x) = x + 2
g(x) = 3x

Then g(f(x)) means:

First apply f.
Then apply g to the result.

So:

f(x) = x + 2
g(f(x)) = g(x + 2)
        = 3(x + 2)
        = 3x + 6

This is usually written as g o f, and it is read as “g composed with f”.

The order is very important.

In g o f, the function on the right works first.

g o f means g(f(x))
f works first, then g works

Now compare it with f o g:

g(x) = 3x
f(g(x)) = f(3x)
        = 3x + 2

So:

g o f = 3x + 6
f o g = 3x + 2

They are not the same.

Why Composition Order Matters

Students often think composition behaves like multiplication, where changing order may not change the answer. But functions are actions, and actions depend on order.

Think of these two daily actions:

Put socks on, then put shoes on.
Put shoes on, then put socks on.

The same two actions are involved, but the result is not the same.

Functions behave in the same way.

For example:

f(x) = x + 5
g(x) = x^2

Find g(f(x)):

g(f(x)) = g(x + 5)
        = (x + 5)^2

Find f(g(x)):

f(g(x)) = f(x^2)
        = x^2 + 5

These are clearly different.

(x + 5)^2 is not the same as x^2 + 5

So do not rush. Always decide which function enters first.

When Is a Composite Function Defined?

This part is small, but it prevents many mistakes.

A composite function is possible only when the output of the first function is acceptable as the input of the second function.

Suppose:

f: A -> B
g: B -> C

Then g o f is defined as:

g o f: A -> C
g(f(x))

Why does this work?

Because f sends elements from A into B, and g is ready to take elements from B.

So the chain is:

A --f--> B --g--> C

Now suppose g is not defined for the values that f produces. Then the composition may fail.

Example:

f(x) = x - 5
g(x) = sqrt(x)

If we are working with real numbers, g(x) needs x >= 0.

Now:

g(f(x)) = sqrt(x - 5)

This is a real-valued expression only when:

x - 5 >= 0
x >= 5

So the composition is not automatically valid for every real number. Its domain must be checked.

What an Inverse Function Means

An inverse function reverses the original function.

If f sends x to y, then the inverse sends y back to x.

f(x) = y
f inverse(y) = x

For example:

f(x) = 2x + 3

Let:

y = 2x + 3

Solve for x:

y - 3 = 2x
x = (y - 3) / 2

So the inverse function is:

f inverse(x) = (x - 3) / 2

Check it:

f(4) = 11
f inverse(11) = (11 - 3) / 2 = 4

The inverse has brought us back to the original input.

But this works only because f(x) = 2x + 3 never sends two different inputs to the same output.

The Two Conditions for an Inverse

A function is invertible when it is both:

one-one and onto

These two words do different jobs.

ConditionMeaningWhy it matters for inverse
One-oneDifferent inputs have different outputsThe inverse will not get confused
OntoEvery element of the codomain is reachedThe inverse is defined for every codomain element

Together, these conditions make the function bijective.

In school-level language:

invertible means one-one and onto

Let us understand both conditions properly.

Condition 1: The Function Must Be One-One

A function is one-one if two different inputs never have the same image.

In a one-one function:

if f(a) = f(b), then a = b

This means the function does not merge paths.

Example:

f(x) = 3x - 1

Suppose:

f(a) = f(b)

Then:

3a - 1 = 3b - 1
3a = 3b
a = b

So f is one-one.

Now compare this with:

f(x) = x^2

Here:

f(2) = 4
f(-2) = 4

But:

2 != -2

So this function is not one-one when the domain includes both positive and negative real numbers.

That means it cannot have an inverse on that full domain.

Condition 2: The Function Must Be Onto

A function is onto if every element of the codomain is the image of at least one element in the domain.

In simple words:

No codomain element is left unused.

Example:

f: R -> R
f(x) = x + 4

This is onto because every real number can be obtained as an output.

If the output is y, then:

y = x + 4
x = y - 4

For every real y, y - 4 is also real. So every output in R is reached.

Now compare:

f: R -> R
f(x) = x^2

This is not onto because negative numbers in the codomain are never reached.

There is no real x such that:

x^2 = -9

So if the codomain is R, the function leaves many codomain values unused.

This matters for the inverse because the inverse is supposed to start from the codomain of the original function. If some codomain values were never produced, the inverse has no proper original input for them.

Why Domain and Codomain Decide the Answer

One of the biggest mistakes in inverse function questions is looking only at the formula.

The same formula can be invertible or not invertible depending on the domain and codomain.

Look at:

f(x) = x^2

Case 1:

f: R -> R
f(x) = x^2

This is not one-one, because 2 and -2 both give 4.

It is also not onto, because no negative real number is reached.

So it is not invertible.

Case 2:

f: [0, infinity) -> [0, infinity)
f(x) = x^2

Now the domain has only non-negative values.

In this domain, two different inputs do not give the same output. Also, every non-negative output can be reached.

So this restricted function is invertible.

Its inverse is:

f inverse(x) = sqrt(x)

This is a very important lesson.

The Role of Range

The range is the set of outputs that the function actually produces.

The codomain is the set where the outputs are expected to lie.

These two may be the same, or they may be different.

Example:

f: R -> R
f(x) = x^2

The codomain is:

R

But the range is:

[0, infinity)

So the function is not onto.

If we instead define:

f: R -> [0, infinity)
f(x) = x^2

Now the codomain matches the range, so the function is onto. But it is still not one-one because 2 and -2 both give 4.

So it is still not invertible.

To make it invertible, we must also restrict the domain:

f: [0, infinity) -> [0, infinity)
f(x) = x^2

Now it is one-one and onto.

How to Check Whether an Inverse Exists

Use this sequence every time.

Step 1: Read the domain and codomain.
Step 2: Check whether the function is one-one.
Step 3: Check whether the function is onto.
Step 4: If both are true, the inverse exists.
Step 5: If asked, find the inverse rule.

Here is the same test in a table:

Question to askIf yesIf no
Does each input have exactly one output?It is a functionIt is not a function
Do different inputs have different outputs?One-one passesInverse cannot exist
Is every codomain element reached?Onto passesInverse is not defined for the full codomain
Are both one-one and onto true?Inverse existsInverse does not exist

This checklist is stronger than memorising examples because it works for mappings, formulas, and worded questions.

Solved Example 1: A Linear Function

Check whether the function is invertible:

f: R -> R
f(x) = 5x - 7

First check one-one.

Assume:

f(a) = f(b)

Then:

5a - 7 = 5b - 7
5a = 5b
a = b

So the function is one-one.

Now check onto.

Let the output be any real number y.

y = 5x - 7
y + 7 = 5x
x = (y + 7) / 5

For every real y, (y + 7) / 5 is also real. So every real output is reached.

The function is onto.

Since it is one-one and onto, it is invertible.

The inverse is:

f inverse(x) = (x + 7) / 5

Solved Example 2: A Quadratic Function

Check whether the function is invertible:

f: R -> R
f(x) = x^2 + 1

First check one-one.

f(2) = 2^2 + 1 = 5
f(-2) = (-2)^2 + 1 = 5

Two different inputs give the same output.

So the function is not one-one.

It is also not onto from R to R, because outputs less than 1 are never reached.

Therefore, the function is not invertible.

Now see how the answer changes if the domain and codomain are changed:

f: [0, infinity) -> [1, infinity)
f(x) = x^2 + 1

On the domain [0, infinity), the function increases steadily. Different inputs give different outputs, and every value from 1 onward is reached.

So this restricted version is invertible.

Find the inverse:

y = x^2 + 1
y - 1 = x^2
x = sqrt(y - 1)

Therefore:

f inverse(x) = sqrt(x - 1)

with domain:

[1, infinity)

Solved Example 3: A Function That Is One-One but Not Onto

Check whether the function is invertible:

f: N -> N
f(n) = n + 1

Here, assume natural numbers start from 1.

The function is one-one because different inputs give different outputs:

1 -> 2
2 -> 3
3 -> 4

No two inputs merge.

But it is not onto because 1 in the codomain is never reached.

There is no natural number n such that:

n + 1 = 1

That would give:

n = 0

But 0 is not in the domain if we are using N = {1, 2, 3, ...}.

So the function is one-one but not onto. Therefore, it is not invertible from N to N.

Solved Example 4: A Composite Function With Domain Check

Let:

f(x) = x + 1
g(x) = 1 / x

Find g(f(x)).

Since:

f(x) = x + 1

we get:

g(f(x)) = 1 / (x + 1)

But this is not defined when:

x + 1 = 0
x = -1

So:

g o f = 1 / (x + 1), x != -1

Now find f(g(x)).

f(g(x)) = f(1 / x)
        = (1 / x) + 1

This is not defined when:

x = 0

So:

f o g = (1 / x) + 1, x != 0

Notice that the expressions and restrictions are different.

This is why order matters.

How Composition Helps Prove an Inverse

If g is the inverse of f, then applying f and then g must bring you back to the starting point.

Also, applying g and then f must bring you back to the starting point.

In notation:

g(f(x)) = x
f(g(x)) = x

More carefully:

g o f = identity function on the domain of f
f o g = identity function on the codomain of f

That is the real meaning of inverse.

Example:

f(x) = 2x - 3
g(x) = (x + 3) / 2

Check g(f(x)):

g(f(x)) = g(2x - 3)
        = ((2x - 3) + 3) / 2
        = 2x / 2
        = x

Check f(g(x)):

f(g(x)) = f((x + 3) / 2)
        = 2((x + 3) / 2) - 3
        = x + 3 - 3
        = x

Both compositions return x, so the two functions undo each other.

A Quick Graph Test for Inverse Possibility

When you are dealing with real functions and graphs, the horizontal line test is helpful.

A graph passes the horizontal line test if any horizontal line cuts the graph at most once.

If a horizontal line cuts the graph in two or more places, then two different inputs have the same output.

That means the function is not one-one.

Example:

y = x^2

A horizontal line such as y = 4 cuts the graph at:

x = 2 and x = -2

So y = x^2 is not one-one on the full real domain.

But if we restrict the domain to:

x >= 0

then the right half of the parabola passes the horizontal line test. That restricted function can have an inverse.

This graph idea is especially useful for modulus, quadratic, and trigonometric functions.

How to Find an Inverse Rule

Once you know the inverse exists, use this method.

Step 1: Write y = f(x).
Step 2: Solve the equation for x.
Step 3: Replace y by x in the final inverse rule.
Step 4: State the domain of the inverse if needed.
Step 5: Check using composition if the question asks for verification.

Example:

f(x) = (3x + 2) / 5

Step 1:

y = (3x + 2) / 5

Step 2:

5y = 3x + 2
5y - 2 = 3x
x = (5y - 2) / 3

Step 3:

f inverse(x) = (5x - 2) / 3

Quick check:

f inverse(f(x)) = x
f(f inverse(x)) = x

If both checks work, your inverse rule is correct.

The Most Common Mistakes

MistakeWhy it is wrongBetter habit
Finding an inverse without checking one-one and ontoThe inverse may not existCheck invertibility first
Thinking g o f and f o g are always equalFunction order mattersWork from right to left
Ignoring the domainThe same formula can behave differentlyRead the stated sets first
Ignoring the codomainOnto depends on the codomainCompare range with codomain
Writing both +sqrt(x) and -sqrt(x) as an inverseAn inverse function must give one outputRestrict the domain before inverting
Cancelling carelessly in compositionsRestrictions may be lostNote excluded values

The last mistake is very common.

For example:

f(x) = x / (x - 1)

Here x = 1 is not allowed. If simplification later hides that restriction, the final answer may look neat but still be incomplete.

A Simple Decision Map

Use this before you start writing long algebra.

Is the relation actually a function?
If no, stop.
If yes, continue.

Are different inputs forced to have different outputs?
If no, inverse does not exist.
If yes, continue.

Does the function reach every element of the codomain?
If no, inverse does not exist for that codomain.
If yes, inverse exists.

For composite functions:

Which function works first?
Is the first output allowed inside the second function?
What restrictions appear?
After substituting, can the expression be simplified safely?

This map turns most questions into a careful reading exercise instead of a memory test.

Practice Set With Answers

Try these before reading the answers.

Question 1

Let:

f(x) = x - 4
g(x) = x^2

Find g o f and f o g.

Answer:

g o f = g(x - 4) = (x - 4)^2
f o g = f(x^2) = x^2 - 4

They are not equal.

Question 2

Is the function invertible?

f: R -> R
f(x) = 7x + 2

Answer:

Yes. It is one-one and onto.

Its inverse is:

f inverse(x) = (x - 2) / 7

Question 3

Is the function invertible?

f: R -> R
f(x) = x^2 - 3

Answer:

No. It is not one-one because 2 and -2 give the same output.

It is also not onto from R to R, because outputs less than -3 are not reached.

Question 4

Make this function invertible by changing the domain and codomain:

f(x) = x^2 - 3

One possible answer:

f: [0, infinity) -> [-3, infinity)
f(x) = x^2 - 3

Then:

f inverse(x) = sqrt(x + 3)

Question 5

Let:

f(x) = sqrt(x)
g(x) = x - 2

Find the restriction for f(g(x)).

Answer:

f(g(x)) = sqrt(x - 2)

For real values:

x - 2 >= 0
x >= 2

So x >= 2.

How to Revise This Topic

Do not revise inverse functions by only solving ten algebra questions.

Use three layers.

First, revise the language:

domain
codomain
range
one-one
onto
identity function
composite function
inverse function

Second, revise the tests:

f(a) = f(b) implies a = b
range equals codomain
g(f(x)) = x
f(g(x)) = x

Third, solve mixed questions:

find g o f
find f o g
check whether inverse exists
find inverse if it exists
restrict domain to make inverse possible

This order matters. If the language is weak, the algebra becomes mechanical and confusing. If the concept is clear, even a long question feels manageable.

Final Takeaway

Composition is about following a path forward through two function rules.

Inverse is about walking that path back without confusion.

If the function merges two inputs, the way back is unclear. If it misses some codomain values, the inverse has nowhere to start for those values. That is why an inverse exists only when the function is one-one and onto.

So before finding an inverse, ask:

Did the function preserve each input separately?
Did it reach every required output?

If the answer to both is yes, the inverse exists.

Frequently Asked Questions

What is a composite function?

A composite function is formed when one function is applied after another. If f(x) works first and then g(x) works on the result, the composite function is g(f(x)), written as g o f.

In g o f, which function works first?

In g o f, the function on the right works first. So f works first, and then g works on the output of f.

Are g o f and f o g always equal?

No. Usually they are different. Function composition depends on order, so always calculate both separately unless the question gives a special reason.

When does an inverse function exist?

An inverse function exists when the function is both one-one and onto. This means different inputs must give different outputs, and every element of the codomain must be reached.

Why is f(x) = x^2 not always invertible?

On the full real domain, x^2 is not one-one because 2 and -2 both give 4. It also does not reach negative real numbers if the codomain is R. But if the domain is restricted to [0, infinity) and the codomain is [0, infinity), it becomes invertible.

What is the difference between range and codomain?

The codomain is the set where outputs are expected to lie. The range is the set of outputs the function actually produces. A function is onto only when its range equals its codomain.

How do I find the inverse of a function?

Write y = f(x), solve for x, then rewrite the result as the inverse function. Before doing this, make sure the function is one-one and onto for the stated domain and codomain.

How can I check whether my inverse answer is correct?

Use composition. If g is your inverse of f, then g(f(x)) should return x, and f(g(x)) should also return x, with the correct domain restrictions.

Looking for commerce tuitions?

Prachi is a gold-medalist commerce teacher with experience at Deloitte and KPMG. She focuses on fundamentals to build a strong foundation.

Start classes