Let $HAUSS$ be the category of all Hausdorff spaces and $i:\mathbb{Q}\rightarrow \mathbb{R}$ be the inclusion map. I am studying a book on Homology theory. It is mentioned there, that the map $i$ is monomorphism as well as epimorphism because $\mathbb{Q}$ is dense in $\mathbb{R}$. But it is not an isomorphism.
My question is that, it can be clearly seen that $i$ is not an homeomorphism (hence isomorphism) but how can we say that $i$ is an epimorphism using the densness of $\mathbb{Q}$. Where in category theory a map $f$ will be an epimorphism if it can be right cancelled.
Suppose $f\circ i = g\circ i$, $f,g: \mathbb R\to X$ where $X$ is Hausdorff.
Then $\{x \in \mathbb R\mid f(x) = g(x)\} \supset \mathbb Q$ by hypothesis, and it's closed in $\mathbb R$ (because it's $h^{-1}(\Delta_X)$, where $h: \mathbb R\to X\times X, x\mapsto (f(x),g(x))$ and $\Delta_X = \{(y,y)\in X\times X\}$ , and $\Delta_X$ is closed in $X\times X$ by Hausdorffness), therefore it contains $\overline{ \mathbb Q} = \mathbb R$.
So $f(x) = g(x)$ for all $x\in \mathbb R$, in other words $f=g$.