- Your function mentioned in code snippet differ from function shown on figure in your question. I MWE below consider the first one, however is not difficult to change it.
- In my MWE below I use package
pgfdplots version v1.14.
- minimal
x value is select so, that the function equation can fit in diagram.
\documentclass[margin=3mm]{standalone}
\usepackage{pgfplots}
\pgfplotsset{compat=1.14}
\begin{document}
\begin{tikzpicture}
\begin{axis}[
ticklabel style={fill=white, font=\footnotesize},
xmin=-5, xmax=3, xlabel={$x$}, xtick={-5,...,3},
ymin=-5, ymax=3, ylabel={$y$}, ytick={-5,...,3},
grid,
axis lines=middle
]
\addplot[blue, very thick, samples=50, domain=-2:1.8] {(x)^3 -(x)^2 + 1};
\node[below right, fill=white, text=blue] at (-4,3) {$f(x) = x^3 - x^2 + 1$};
\end{axis}
\end{tikzpicture}
\end{document}

In case, that you like to have second equation, than adequately change lines \addplot ... and \node .... You also can put axis on the top and enlarge graph width and function domain as follows:
\documentclass[margin=3mm]{standalone}
\usepackage{pgfplots}
\pgfplotsset{compat=1.14}
\begin{document}
\begin{tikzpicture}
\begin{axis}[
width=88mm,
ticklabel style={fill=white, inner xsep=1pt, font=\footnotesize},
xmin=-5, xmax=4, xlabel={$x$}, xtick={-5,...,4},
ymin=-5, ymax=3, ylabel={$y$}, ytick={-5,...,3},
set layers = axis on top,
axis lines = middle,
grid=both,
]
\addplot[blue, very thick, samples=50, domain=-2:4] {-5*(x^4)/16 + 3*(x^3)/4 + 1};
\node[below right, inner xsep=0pt, fill=white, text=blue] at (-5,3)
{$f(x) = -\frac{5}{16}x^4 + \frac{3}{4}x^3 + 1$};
\end{axis}
\end{tikzpicture}
\end{document}
and the graph will become:

pgfplots(see for example https://tex.stackexchange.com/a/78383/586). And remember that you need to explicitly write the multiplication symbol, e.g.2*xand not2x. – Torbjørn T. Jun 13 '17 at 22:07