You say that has 4 continuous derivatives but then ask about g?
Also, does the problem really say "4 continuous derivatives"? This is true of any function that has 2 continuous functions. Also can we take it that "i" is just a variable and not such that ?
Finally, where did that "h" come from? Are you sure the final equation shouldn't be (f(i+h)- 2f(i)+ f(i- h))/h^2= f''(i)+ O(h^2) ??
Write f(x) as a Taylor's polynomial of degree 2, about x= i, and do the algebra to find the left side of that equation.