Equivalence between definitions of identification map I am reading Bert Mendelson's Introduction to Topology, and am working through the section on identification topologies. In the book, he gives the definition of an identification map as follows:
Let $p: X \rightarrow Y$ be a continuous map from the topological space $X$ into the topological space $Y$. Then $p$ is an identification if for each subset $U$ of $Y$, $p^{-1}(U)$ open in $X$ implies that $U$ is open in $Y$.
The other definition I have seen on wikipedia and elsewhere is that asserts the surjectivity of the map: $p$ is an identification map if it is surjective, and a subset $U$ of $Y$ is open iff $p^{-1}(U)$ is open.
I can see where the if and only if bit bit comes from in the second definition (since the first definition asserts the continuity of $p$). But I don't see how the first definition gives us the surjectivity specified in the second definition.
Is there a way to deduce the surjectivity from the first definition? Or are these definitions simply different?
[Note: In the book, when we actually deal with the identification topology, we turn the map $\pi_f: X \rightarrow X/\sim_f$ ,where $\sim_f$ is the usual equivalence relation on $X$, into an identification by defining the topology appropriately. $\pi_f$ is indeed surjective (obviously), but it was surjective before 'turning it into' an identification. So I am not sure that the definition given in the book implies surjectivity in general.]
 A: The first definition does not imply surjectivity. For a simple example, consider the natural injection $p \colon \mathbb{N} \to \mathbb{Z}$ where both spaces are endowed with the discrete topology. Since all subsets of either space are open, this clearly satisfies the first definition. But there are negative integers, hence $p$ is not surjective.
Generally, in the situation of the first definition, $Z = p(X)$ must be an open subset of $Y$, and $p$ is an identification map in the sense of the second definition when viewed as a map to $Z$ (endowed with the subspace topology). But that (being an identification map to the image and having open image) is not sufficient to be an identification map in the sense of the first definition, since $p^{-1}(U)$ is open whenever $U \cap p(X) = \varnothing$. Thus to be an identification map per the first definition, $p$ must be an identification map from $X$ to $p(X)$ per the second definition, and additionally $p(X)$ must be open and closed in $Y$, and $Y \setminus p(X)$ must be discrete.
