An example in Tikz:
More examples and code are at 
http://www.texample.net/tikz/examples/ 
and the manual http://mirror.ctan.org/graphics/pgf/base/doc/generic/pgf/pgfmanual.pdf

    \documentclass[a4paper]{article}
    \usepackage{tikz}
    \usetikzlibrary{shapes}
    \begin{document}
    \begin{tikzpicture}
        \node [name=oct,regular polygon,regular polygon sides=8,minimum size= 10em] {text};
        \node at (oct.corner 1) [name=octCorner1] {$x_1$};
        \node at (oct.corner 2) [name=octCorner2] {$x_2$};
        \node at (oct.corner 3) [name=octCorner3] {$x_3$};
        \node at (oct.corner 4) [name=octCorner4] {$x_4$};
        \node at (oct.corner 5) [name=octCorner5] {$x_5$};
        \node at (oct.corner 6) [name=octCorner6] {$x_6$};
        \node at (oct.corner 7) [name=octCorner7] {$x_7$};
        \node at (oct.corner 8) [name=octCorner8] {$x_8$};
        \draw [double,-stealth,shorten <=5pt,shorten >=5pt] (oct.corner 1) -- node[above right]{$g(x)$} (oct.corner 8);
        \draw [stealth-stealth,shorten <=5pt,shorten >=5pt] (oct.corner 3) -- (oct.corner 4);
        \draw [-stealth,shorten <=5pt,shorten >=5pt] (oct.corner 5) --node[above]{$f(x)$} (oct.corner 6);

    \end{tikzpicture}
    \end{document}