However, this is wrong. It should be $\displaystyle z^2+zi-1$. I'm not sure how one would arrive here, however.
Try using the Difference of Two Cubes Rule:
$\displaystyle z^3 + i = z^3 - (-i)$
$\displaystyle = z^3 - i^3$
$\displaystyle = (z - i)(z^2 + iz + i^2)$
$\displaystyle = (z - i)(z^2 + iz - 1)$.
So $\displaystyle \frac{z^3 + i}{z - i} = \frac{(z - i)(z^2 + iz - 1)}{z - i}$
$\displaystyle = z^2 + iz - 1$.