Monomorphisms and epimorphisms in the category of finite coverings of a topological space I'm working my way through Lenstra's Galois Theory for Schemes, and I've run into a bit of a conundrum with Exercise 3.14(b).
In this exercise, we consider the category $\textbf{FC}_X$ of finite coverings $Y\xrightarrow{\pi_Y} X$ of a fixed topological space $X$, with morphisms given by continuous maps $Y\xrightarrow{h} Z$ such that the appropriate diagram commutes, i.e. $\pi_Z\circ h=\pi_Y$.  [Note:  I would put the diagram itself, but \xymatrix isn't supported in MathJaX: is there something analogous that can be used here to make commutative diagrams?]
Part (b) of the problem is to show that $h:Y\rightarrow Z \ $ being a monomorphism in $\textbf{FC}_X$ is equivalent to $h$ being injective and $h$ being an epimorphism in $\textbf{FC}_X$ is equivalent to $h$ being surjective.  The implications "$h$ surjective" $\Rightarrow$ "$h$ epic" and "$h$ injective" $\Rightarrow$ "$h$ monic" are both almost immediate, so there's no trouble there.
In order to show that monic $h$ are injective, I supposed that $h(y)=h(y')$ for some $y,y'\in Y$, and considered the covering $\pi_Y':Y\rightarrow Z$ given by $\pi_Y'(y'')\equiv\pi_Y(y)$, for $y''\in Y$, and the maps $f,g:Y\rightarrow Y$ defined by $f(y'')\equiv y$ and $g(y'')\equiv y'$.  These are constant, so they are continuous, and some simple algebra shows that $(f\circ\pi_Y)(y'')=(g\circ\pi_Y)(y'')=\pi_Y'(y'')$; hence they are morphisms in $\textbf{FC}_X$.  Moreover, some more simple playing with compositions yields $(h\circ f)(y'')=(h\circ g)(y'')$ for all $y''\in Y$, and so the fact that $h$ is a monomorphism implies that $y\equiv f=g\equiv y'$; therefore $h$ is injective, as desired.
The only possible problem I see with the above argument is that $\pi_Y'$ is, emphatically, not surjective, but Lenstra (much like Hatcher) doesn't seem to require coverings to be surjective, so I thought nothing of this point.  Moving onto the "epic implies surjective" part -- in light of the fact that I decided coverings are not required to be surjective -- I figured a similar argument could easily be found.... but after MUCH effort, I can't seem to find appropriate choices of $f$ and $g$ to get the sort of diagram present in the definition of epimorphisms... at least not one which will give me, for every $z\in Z$, $h(y)=z$ for some $y\in Y$.
So now I'm wondering: are these coverings meant to be surjective (in which case this part of the problem is trivial)?  If so, then does anyone know how I can adjust the argument regarding injectivity (since $\pi_Y'$ is not surjective, so it wouldn't be a covering)?  If not, can anyone see what the right choice of a covering $Y'\xrightarrow{\pi_{Y'}}X$ and morphisms $f,g:Z\rightarrow Y'$ are to give me that $h$ is surjective?  Am I just missing some small, stupid, obvious detail?
Any help with this would be greatly appreciated... I keep trying, but cannot seem to finish this one bit of the problem up...
 A: Coverings are not assumed to be surjective, actually this will become important later on in the book. [Many authors just do it wrong and assume coverings to be surjective, but then the category is ill-behaved and certain constructions only work under case distinctions etc.]
Here is a hint how to show surjectivity of an epimorphism: Use exercise 3.5. It characterizes epimorphisms via pushout diagrams. Then use the explicit construction of pushouts in the category of finite coverings.
By the way, this is the same "trick" which is used to characterize epimorphisms in (certain) functor categories.
A: I think the proof of the fact that monic implies injective provided by the OP is wrong. I believe that $\pi'_Y:Y\to X$ isn't a covering. The point isn't the fact that it isn't surjective (I agree that coverings shouldn't be assumed surjective), but the fact that it doesn't satisfy the property required in the definition. Unless $\lbrace \pi_Y(y)\rbrace$ is open, you can't find an open neighbourhood $U$ of $\pi_Y(y)$ such that $\pi'_Y$ is trivial above $U$. I think you can use an approach similar to the one described by Martin Brandenburg also for monomorphisms (see exercise 3.15(a) in Lenstra's book). 
There is also another proof of the fact that epic implies surjective, along the same lines as the OP's original idea. Consider the discrete topological space $E=\lbrace a,b\rbrace$, with $a\neq b$, and the trivial covering $X\times E\to X$. Define $f: Y\to X\times E,\; y\mapsto (\pi_Y(y),a)$ and $g: Y\to X\times E,\; y\mapsto \begin{cases} (\pi_Y(y),a) & \mbox{if }z\in h(Y) \\ (\pi_Y(y), b) & \mbox{if }z\notin h(Y) \end{cases}$. Check that $f$ and $g$ are morphisms of coverings (in order to prove that $g$ is continuous, you need exercise 3.14(a) of Lentra's book, which says that $h(Y)$ is both open and closed in $Z$) and that $f\circ h=g\circ h$.
