Question: are f and g the same?
Answer: Yes, they are the same. You just have to factor the (x2 - 1) in the numerator of f(x) and cancel out the (x + 1).