$\displaystyle G(x)=\sum_{k=0}^{\infty}{a_k\cdot{x^k}}$ where we want $\displaystyle a_k=k$ (we'll assume $\displaystyle x$ will be on the interval of convergence, that is $\displaystyle (-1;1)$ )

Now the condition can be stated as:

$\displaystyle a_{k+1}=a_k+1$ where $\displaystyle a_0=0$

Multiplying by $\displaystyle x^{k+1}$ on both sides:

$\displaystyle a_{k+1}\cdot{x^{k+1}}=a_k\cdot{x^{k+1}}+x^{k+1}$

That is:

$\displaystyle a_{k+1}\cdot{x^{k+1}}=x\cdot{a_k\cdot{x^{k}}}+x^{k +1}$

Now sum from $\displaystyle k=0$ to $\displaystyle +\infty$:

$\displaystyle \sum_{k=0}^{\infty}{a_{k+1}\cdot{x^{k+1}}}=x\cdot{ \sum_{k=0}^{\infty}{a_{k}\cdot{x^{k}}}}+\sum_{k=0} ^{\infty}{x^{k+1}}$

Thus we have:

$\displaystyle G(x)-a_0=x\cdot{G(x)}+\sum_{k=1}^{\infty}{x^{k}}=x\cdot {G(x)}+\frac{x}{1-x}$

Thus, since $\displaystyle a_0=0$:

$\displaystyle (1-x)\cdot{G(x)}=\frac{x}{1-x}$ and $\displaystyle G(x)=\frac{x}{(1-x)^2}$

You can use this method to work with other sequences where you have a recurrence