How to verify whether two functions are inverses of each other

Given two functions f(x) and g(x), if
(f o g) (x) = x
and
(g o f) (x) = x

then both f(x) and g(x) are inverses of each other.

For example, given two functions
f(x) = 5x + 2
g(x) = (x - 2)/5
Then (f o g)(x) and (g o f)(x) can be found out,
(f o g)(x) = f(g(x)) = f( (x - 2)/5 )
=  5((x - 2)/5) + 2
= x - 2 + 2
= x
So (f o g)(x) = x. Now calculate (g o f)(x),
(g o f)(x) = g(f(x)) = g(5x + 2)
=  ((5x + 2) - 2)/5
= (5x + 2 - 2) / 5
= 5x / 5
= x
Thus (g o f)(x) = x, and (f o g)(x) = x. Thus f(x) and g(x) are inverse functions.

Search This Blog