Let $z$ be an affine coordinate on $\mathbb{P}^1$. Consider the curve $Y$ defined by the equation
$$ y^2=\prod_{i=1}^{n}(z-z_i), $$
where $z_i \in \mathbb{C}$ are distinct.
$1)$ Then, the curve Y covers $\mathbb{P}^1$ by a map of degree $2$, give by the function $z$. That is, $z:Y\longrightarrow \mathbb{P}^1 $ a map of degree 2.
Question: Why $1)$ is it true? Why $z$ is a function of degree $2$ defined in $Y$ covering $\mathbb{P}^1$?