Encircle a formula with arrow pointing from the circle

The best approach depends on whether your sketch is meant as a single image---in this case use a single tikzpicture environment---or whether the items appear mixed with text on a page---in this case use the \tikznode command from this post. Here are examples for both situations. Note that you have to run LaTeX twice on the second example.

Everything in a single picture: The position of the elements can be specified explicitly relative to each other.

enter image description here

\documentclass[border=1pt]{standalone}
\usepackage{tikz}
\usetikzlibrary{positioning}
\begin{document}
\begin{tikzpicture}
  \node[circle,draw](fx){$f(x)$};
  \node(a)[below right=of fx]{$a$};
  \draw[->] (fx) -- (a);
\end{tikzpicture}
\end{document}

Graphical elements as part of text: The position of the elements is defined implicitly by the typesetting engine that positions the elements. For examples of the use of \tikznode see e.g. Breaking numbers Simple addition, How to add arrow in equations and matrix? or how can you point the head of an arrow from tikzpicture to an equation in LaTex?.

enter image description here

\documentclass{article}
\usepackage{tikz}
\newcommand\tikznode[3][]%
   {\tikz[remember picture,baseline=(#2.base)]
      \node[minimum size=0pt,inner sep=0pt,#1](#2){#3};%
   }
\begin{document}
\[ \frac{g(x)}{\tikznode[circle,draw]{fx}{$f(x)$}}
  =\frac{g(x)}{\tikznode{a}{$a$}}
\]
\begin{tikzpicture}[remember picture,overlay]
  \draw[->] (fx) edge[bend right] (a);
\end{tikzpicture}
\end{document}

Maybe something like this?

\documentclass{article}
\usepackage{tikz,blindtext}
\newcommand{\mycircle}[2]{\begin{tikzpicture}[remember picture]
                            \node[draw,circle] (#2) {$#1$};
                            \draw[->] (#2) --+ (1,-1) node[below right] {$#2$};
                          \end{tikzpicture}
                         }
\begin{document}
    \blindtext\par
    \mycircle{f(x)}{a}\par
    \blindtext
\end{document}

Here is the output:

Screenshot

EDIT: The denominator isn't overlapped:

MWE:

\documentclass{article}
\usepackage{tikz,blindtext}
\newcommand{\mycircle}[2]{\begin{tikzpicture}[remember picture]
                            \node[draw,circle] (#2) {$#1$};
                            \draw[->] (#2.south east) --+ (1,-1) node[below right] {$#2$};
                          \end{tikzpicture}
                         }
\begin{document}
    \blindtext\par
    \mycircle{f(x)}{a}\par
    \[
        \frac{f(x)}{\mycircle{g(x)}{a}}
    \]
    \blindtext\par
\end{document}

Output:

Screenshot