Solution (source code)

= Solution

Since $a_0=f(0)\ne0$, write $1/f(x)=b_0+b_1x+b_2x^2+O(x^3)$ and multiply the two <power series>. Equating coefficients with the identity $f(x)/f(x)=1$ gives
$$
a_0b_0=1,\qquad a_0b_1+a_1b_0=0,\qquad a_0b_2+a_1b_1+a_2b_0=0.
$$
Solving successively yields
$$
\boxed{\frac1{f(x)}=\frac1{a_0}-\frac{a_1}{a_0^2}x+\frac{a_1^2-a_0a_2}{a_0^3}x^2+O(x^3).}
$$
These are the constant, linear and quadratic terms; particular coefficients may vanish. For a convergent <power series> defining $f$ near zero, continuity and $a_0\ne0$ ensure its reciprocal is also defined in a neighborhood of zero.