You should use the following algorithm to find the inverses of the given functions, `f(x)` and `g(x), ` such that:

`y = 3x + 1 => y - 1 = 3x => x = y/3 - 1/3`

`y = x + 2 => x = y - 2`

Hence, evaluating the inverses of the givn functions yields `f^(-1)(x) = x/3 - 1/3` and `g^(-1)(x) = x - 2` .

You may evaluate `(f - g)(x)` such that:

`(f - g)(x) = f(x) - g(x)`

`(f - g)(x) = 3x + 1 - (x + 2)`

`(f - g)(x) = 3x + 1 - x - 2 => (f - g)(x) = 2x - 1`

You may evaluate `(f - g)(5)` substituting 5 for x in equation of `(f - g)(x)` such that:

`(f - g)(5) = 2*5 - 1 = 9`

**Hence, evaluating `f^(-1)(x), g^(-1)(x), (f - g)(x)` and `(f - g)(5)` yields `f^(-1)(x) = x/3 - 1/3, g^(-1)(x) = x - 2, (f - g)(x) = 2x - 1` and `(f - g)(5) = 9` .**

The function f(x) = 3x + 1 and g(x) = x + 2.

f(x) = 3x + 1.

`f(f^-1(x)) = x`

=> `3*f^-1(x) + 1 = x`

=> `f^-1(x) = (x - 1)/3`

The inverse function `f^-1(x) = (x - 1)/3`

`g(x) = x + 2`

`g(g^-1(x)) = x`

=> `g^-1(x) + 2 = x`

=> `g^-1(x) = x - 2`

The inverse function `g^-1(x) = x - 2.`

`(f - g)(x) = 3x + 1 - x - 2 = 2x - 1`

`(f - g)(5) = 2*5 - 1 = 9`