Answer
$$f(x)=x^{3}-4x+5$$
Work Step by Step
$$f'(x)=g'(x)$$
$$\int f'(x) dx=\int g'(x) dx$$
$$f(x)=g(x)+c$$
$$f(x)=x^{3}-4x+6+c$$
Find $c$ using that $f(1)=2$.
$$f(1)=1^{3}-4\cdot 1+6+c$$
$$2=1^{3}-4\cdot 1+6+c$$
$$2=1-4+6+c$$
$$2=3+c$$
$$2-3=c$$
$$-1=c$$
So the equation of $f$ is:
$$f(x)=x^{3}-4x+6-1$$
$$f(x)=x^{3}-4x+5$$