In y complex analysis course we learned a theorem about the roots of a complex, nonconstant, holomorphic polynomial.
That if $p(z)$ is nonconstant and holomorphic then $p$ has a root, i.e. for some $\alpha \in \mathbb{C}$ we have that $p(\alpha) = 0$.
But wouldn't $p(z) = z^2 + 1$, not have a root but is also holomorphic and nonconstant?
$$p(z) = z^2 + 1$$ has two roots as promised by the theorem.
Both $ z=i$ and $z=-i$ satisfy $z^2+1=0$ so they are roots of $p(z) = z^2 + 1$
Probably you were expecting real roots.
Well, the theorem did not prove that the roots are necessarily real.