So I have the following LaTeX code
\begin{equation*}
\lim_{x\to x_{0}}\dfrac{\overbrace{f(x)}^{\to 0}}{\underbrace{\hat{g}(x)}}_{\to 0}
\end{equation*}
For some reason the \underbrace command is not behaving as it should. Everything behaves normally when I use the \overbrace command and the text appears directly above the brace, but when I try to do the same thing for \underbrace LaTeX insists on writing the text to the right of the lower brace instead of directly below it. I've looked around the TeX forums and from what I've seen this approach should work just fine. In fact it does work properly outside the "equation" environment. I was wondering how to get it to work properly within an equation, hopefully without having to make the code too complicated.