I would like to get in LaTeX what the following code produces on Math.SE:
$$\pi(X,Y)\to HoM(X,Y)\\\
[f]\mapsto[RQf]$$

And if I wanted to have an equation number to the right of the two lines, how would I do that?
I would like to get in LaTeX what the following code produces on Math.SE:
$$\pi(X,Y)\to HoM(X,Y)\\\
[f]\mapsto[RQf]$$

And if I wanted to have an equation number to the right of the two lines, how would I do that?
For example (Please observe changing of the meaning of HoM. I am assuming that it is your intention):
\documentclass{article}
\usepackage{amsmath}
\DeclareMathOperator{\HoM}{Hom}
\begin{document}
The first bijection is induced...
\begin{equation}
\begin{aligned}
\pi(X,Y)&\to\HoM(X,Y)\\
[f]&\mapsto[RQf]
\end{aligned}
\end{equation}
if $X$ is cofibrant and $Y$ fibrant.
\end{document}

alignedenvironment may be a bit of overkill in this case, as there's only a single alignment point. Asplitenvironment will do the job as well, I think. – Mico Oct 18 '14 at 22:49$$in a LaTeX document is deprecated; use\[ ... \]instead for unnumbered displayed equations. For more information, see the posting Why is [ ... ] preferable to $$ … $$? – Mico Oct 18 '14 at 22:53