$\frac{1}{1-x} = 1 + x + x^2 + x^3 + x^4 + x^5 + \dots + \infty$
Differentiating it w.r.to $x$
$\frac{1}{(1-x)^2} = 1 + 2x + 3x^2 + 4x^3 + 5x^4 + \dots + \infty$
$\sum_{i=0}^{\infty} g(i)x^i = g(0) + g(1)x + g(2)x^2 + g(3)x^3 + \dots + \infty$
Comparing above two, we get $g(1) = 2, g(2) = 3 \color{red}{\Rightarrow g(i) = i+1}$