I need to show that if $X$ is a covering space of $Y$ with the covering map $p$ and $Y$ is connected, then $p^{-1}(y)$ have the same cardinality for every $y\in Y$.
I have this hint: A function $f:W\to Z$ is locally constant iff each $w\in W$ has an open neighbourhood $U$ such that $f\restriction_U$ is constant. Show that any locally constant function is continuous.
I've also found a solution which I didn't understand: Let $k$ be a cardinality. Denote those $y$'s by $B_k$ for which $|p^{-1}(y)|=k$. By the "local triviality" (now I absolutely don't know what does that mean, perhaps it has something to do with the hint I found somewhere else), every $B_k$ is open. But they are also closed at the same time because they are all complements of unions of open sets. Since $Y$ is connected, there is a $k$ such that $Y=B_k$.
If you can explain the meaning of "local triviality" and its connection with the hint and also the hint itself I would be very thankful.
The idea (along the lines of the hint) is to define $f:Y\to X$ by $f(y)=|p^{-1}(y)|$. For every $y\in Y$ we have some neighborhood $U$ of $Y$ such that $p^{-1}(U)$ consists of $k$ connected components, each of which are mapped homeomorphically (hence injectively) onto $U$ (incidentally, this is what is meant by the "local triviallity" of $p$, that locally $p$ is just a map from $k$ copies of $U$ to $U$). For any $u\in U$, we have that $|p^{-1}(u)|=k$, since there is exactly $1$ preimage of $U$ in each connected component of $p^{-1}(U)$ by injectivity. Hence $p$ is locally constant. Once you show that $f$ is locally constant, you have that it is continuous. But the image is some ordinal $\omega$ (or if you are only looking at finite coverings, $\mathbb N$) with the discrete topology, and any continuous function from a connected space to a discrete space is constant, hence $f$ is constant.