Maclaurin expansion of $y=\frac{1+x+x^2}{1-x+x^2}$ to $x^4$ 
Maclaurin expansion of $$\displaystyle y=\frac{1+x+x^2}{1-x+x^2}\,\,\text{to } x^4$$

I have tried by using Maclaurin expansion of $\frac1{1-x}=1+x+x^2+\cdots +x^n+o(x^n)$, but it seems not lead me to anything.

The sortest way is division of numerator by the denominator along the increasing powers of $x$:

This division tell us that
\begin{align*}1+x+x^2&=(1-x+x^2)(1+2x+2x^2-2x^4)+x^5(-2+2x)\\
\text{so that}\quad\frac{1+x+x^2}{1-x+x^2}&=1+2x+2x^2-2x^4+\frac{x^5(-2+2x)}{1-x+x^2}\\&=1+2x+2x^2-2x^4+O(x^5).\end{align*}
