You correctly determined that both f and g are inverses of each other as their composition is x. But it DOESN't mean that f(g(x)) == x identically for all x. It only means that f(g(x)) == x identically for all x from the DOMAIN of g. The domain for each of the function f(x) =and g(x) = is the set of all real numbers EXCLUDING x = 0.