Answer
$g(x)=\dfrac{-1}{x}+x^2-1$
Work Step by Step
Here, the derivative is given as: $f'(x)=\dfrac{1}{x^2}+2x$ , thus, the general form of the function is: $f(x)=\dfrac{-1}{x}+x^2+C$
Since the graph of the given function passes through $(-1,1)$, $1+1+C=1 \implies C=-1$
Hence, $g(x)=\dfrac{-1}{x}+x^2-1$