\definecolor{ffqqqq}{rgb}{1,0,0}
\definecolor{qqwuqq}{rgb}{0,0.39215686274509803,0}
\definecolor{qqzzff}{rgb}{0,0.6,1}
\begin{tikzpicture}
\begin{axis}[
axis lines=middle,
ymajorgrids=true,
xmajorgrids=true,
xmin=-3,
xmax=2.5,
ymin=-2.5,
ymax=4,
xtick={-3,-2,...,2},
ytick={-2,-1,...,4},]
\clip(-3,-2.5) rectangle (2.5,4);
\draw[line width=1pt,color=qqwuqq,smooth,samples=100,domain=-3:2.5] plot(\x,{0.5*(\x)^(3)-2*(\x)+2});
\draw [line width=1pt,color=ffqqqq,domain=-3:2.5] plot(\x,{(--2-2*\x)/1});
\draw [line width=1pt,color=qqzzff,domain=-3:2.5] plot(\x,{(-6--4*\x)/1});
\draw [fill=ffqqqq] (0,2) circle (2pt);
\draw[color=ffqqqq] (0.07080767254681156,2.1704476759953577) node[above right] {$A$};
\draw [fill=qqzzff] (2,2) circle (2pt);
\draw[color=qqzzff] (2.063612099644128,2.1156938233985754) node[right] {$B$};
\end{axis}
\end{tikzpicture}