Customizing an axis

Customizing axis lines is a bit unintuitive: For one, the decoration to be used in the postaction needs to be specified within the postaction. And applying a postaction to the axes when using axis lines=left (instead of axis lines=middle, for example) requires the use of the every path/.style. To avoid infinite recursion in this case, you need to clear the postaction once it’s been executed for the first time. This can be done using the nomorepostaction key as here.

\documentclass[border=10pt]{standalone}
\usepackage{pgfplots}
\usetikzlibrary{arrows, decorations.markings}
\makeatletter
\tikzset{
    nomorepostaction/.code=\makeatletter\let\tikz@postactions\pgfutil@empty,
    my axis/.style={
        postaction={
            decoration={
                markings,
                mark=at position 1 with {
                    \arrow[ultra thick]{latex}
                }
            },
            decorate,
            nomorepostaction
        },
        thin,
        -, % switch off other arrow tips
        every path/.append style=my axis % this is necessary
          %so it works both with "axis lines=left" and "axis lines=center"
    }
}
\makeatother
\begin{document}
\begin{tikzpicture}
  \begin{axis}[
      axis lines=center,
      axis line style={my axis}
    ]
    \addplot [domain=-2.8:2.8, smooth, thick] { x^3 - 5*x };
  \end{axis}
\end{tikzpicture}
\end{document}