If you like to use Xy-pic, simply omit the "+" :
\documentclass{beamer}
\usepackage[all]{xy}
\begin{document}
\section{Introduction}
\xymatrix{
& *{\sum_{i=n}^m {i^2}} & + & *{p} \\
& {\bullet} & D \ar@[red][ul] && f \ar@[blue][ul]
}
\end{document}
Indeed, the construction *{object} put the object without margin, the "+" add the margin.
In fact, *+{object} is equivalent to {object} and even (if the object doesn't start with a macro) simply object .
For the color, simply use the @[color] modifier, for more about color, see xyref p.30.
Another solution is to define directly "longarrow", for example :
\documentclass{beamer}
\usepackage[all]{xy}
\newdir{l}{!/1.5ex/@{-}*:(1,0)@^{>}*:(1,0)@_{>}}
\newdir{m}{!/0.5ex/@{-}*@{-}}
\def\longar@[#1][#2]{\ar@[#1]@{-l}[#2] \ar@[#1]@{m-m}[#2]}
\begin{document}
\section{Introduction}
\xymatrix{
&{\sum_{i=n}^m {i^2}} &+&p \\
& {\bullet} & D \longar@[red][ul] && f \longar@[blue][ul]
}
\end{document}