Ok, before people wonder what happened to the tikz solution, here is an alternate method, using, well... tikz. \tikzmark is used to name the location in the equation that you want to refer to. This name is then given to \Insert along with various options to control the behavior of the brace and the line connecting them.

The parameters passed to \Insert are:
#1. Vertical shift to be applied to the brace
#2. Options to control the behavior of the connecting line.
#3. Name of the marker in the equation.
#4. Text to be braced, which is to be inserted.
Notes:
- This does require two runs. First one to determine the locations, and the second to do the drawing.
- Probably will have issues if the text begin inserted is not on the first line as the arrow will probably overlap other text.
References:
Code:
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{calc}
\usetikzlibrary{decorations.pathreplacing}
\newcommand{\tikzmark}[1]{\tikz[overlay,remember picture] \node (#1) {};}
\newcommand{\BraceAmplitude}{0.5em}%
\newcommand{\Insert}[5][0.0ex]{%
\tikzmark{a}#5\tikzmark{b}%
\begin{tikzpicture}[overlay,remember picture]
\draw [decoration={brace,amplitude=\BraceAmplitude},decorate,ultra thick,blue,#2]
($(a.north)+(0,#1)$) -- ($(b.north)+(0,#1)$);
\draw [thick, blue, #3] ($(a.north)!0.5!(b.north)+(0,#1)+(0,\BraceAmplitude+2pt)$) to (#4);
\end{tikzpicture}%
}
\begin{document}
[ f = < x | R \tikzmark{MyMarker} y > ]
\bigskip
In the above equation, we need to insert \Insert[1.5ex]{orange}{out=90, in=-90,->,shorten >=-1pt}{MyMarker}{$\int d^3 p |p> <p| = 1$} before $y$.
[ f = < x | R \tikzmark{MyMarkerA} y \tikzmark{MyMarkerB}> ]
\bigskip
Insert \Insert[1.5ex]{blue}{out=90, in=-90,->,shorten >=-1pt,red}{MyMarkerA}{$\int d^3 p |p> <p| = 1$} before $y$, and some more
\Insert[1.0ex]{brown}{out=135, in=-70,->,shorten >=-2pt}{MyMarkerB}{\textbf{stuff}} after $y$.
\end{document}
\tikzcommands work with theexternalizelibrary? – mSSM Jun 16 '12 at 17:34\tikzmarkis used. If it is a problem you'd probably have to disable externalization for the pictures that use\tikzmark, unless some came up with a better solution. – Peter Grill Jun 16 '12 at 17:59