Measure the object to be quoted; if it's higher than the quotes, raise them.
\documentclass{article}
\usepackage{amsmath}
\makeatletter
\newcommand{\mquote}[1]{{\mathpalette\mqu@te{#1}}}
\newcommand{\mqu@te}[2]{%
\sbox0{$\m@th#1\text{``}$}%
\sbox2{$\m@th#1\text{''}$}%
\sbox4{$\m@th#1#2$}%
\ifdim\ht4>\dimexpr\ht0+1pt\relax
\raisebox{\dimexpr\ht4-\height}{\box0}%
#2%
\raisebox{\dimexpr\ht4-\height}{\box2}%
\else
\box0 #2\box2
\fi
}
\makeatother
\begin{document}
\[
\mquote{x} \implies \mquote{\frac{0}{0}} \implies \mquote{A}
\implies \mquote{\frac{\dfrac{x}{x+1}}{\dfrac{y^2}{y+1}}}
\]
\[
\textstyle \mquote{\frac{0}{0}}
\]
\end{document}

Some explanations. First, the usage of \mathpalette is explained in the answers to The mysteries of \mathpalette so I won't touch that topic; suffice it to say that in the code of \mqu@te, #1 stands for the current style. We need it because math is typeset differently in \displaystyle or in \textstyle. In the same macro, #2 stands for the subformula to be quoted.
The working is easy to explain. I set the quotes in two boxes, using the correct font size corresponding to the math style using \text. In the temporary box register 4 I set the formula to be quoted, so that we can access to its dimensions. Then the code checks whether the height of the formula is more than the height of the quotes (plus a small buffer of 1pt) and, if it is, raises the boxes containing the quotes by the height of the subformula diminished by the height of the quotes (\ht4-\height); in between, the formula is typeset. Otherwise, the boxes containing the quotes are delivered with the subformula in between them.
\heightwith\ht0in\raiseboxnot work? – carloabelli Feb 03 '16 at 18:33\raiseboxtypesets the material in order to set\height,\widthand\depth, so after this the box is empty. I could have used\copy0instead of\box0(which wouldn't clear the box register), but since LaTeX provides\height, it's not necessary. – egreg Feb 03 '16 at 18:35