The problem is as follows:
The force graphed in Figure 1. is applied to a $\textrm{2.0-kg}$ block that was sliding to the right (the $\textrm{+-direction}$) over a frictionless surface with speed $5.0\,\frac{m}{s}$ at $x=0$ (a) Is the block ever at rest? If so,where? (b) Find a position (other than $x=0$) when the block is again moving to the right at $5.0\,\frac{m}{s}$.
The figure alluded in the problem is shown above.
Now the thing with this problem is I really don't know where to begin or if there is something missing in my maths.
Hence my question is how do I know that the block is at rest?.
My first guess is that this happens when the net force on the block is $0$ or that it is not carrying (unsure if this term is right) kinetic energy?. However can this happen in a frictionless surface?. My other question arises from the fact, how do I understand the negative force in the diagram?. Does it mean that is a force that is being applied to the left side of the block?.
So far the only thing I could come up with wad to use Newton's second law:
$f=ma$
Since what it is being asked is the position, I thought to use:
$v^{2}_f=v^{2}_{0}+2a\Delta x$
For $v^{2}_f=0$ and $v_{0}=5\,\frac{m}{s}$,
$0=\left(5\right)^{2}_{0}+2a\Delta x$
But this would mean to use a, from where? From the diagram?.
If so, at $-40 N$ :
$a=\frac{-40}{2}=-20\,\frac{m}{s^2}$
Then:
$0=\left(5\right)^{2}+2\left(-20\right)\Delta x$
Hence:
$\Delta x=\frac{25}{40}=0.625$
Which would translate as a position $x=0$
$x_{1}-x_{0}=0.625-0=0.625\,m$
So this would be at the right from the starting point at $x=0$ and although this seems consistent with what it is alluded in the diagram (the "domain" is in the positive numbers) it doesn't check with the answers in my book.
According to it, the answer for part (a) is $1\,\textrm{m}$ and for part (b) is $2.917\,\textrm{m}$. But again, none of this seems close to what I obtained. What could I be missing in my calculation?.
Anyways. Am I understanding this mathematically or physically wrong?. Can somebody help me to clear these doubts?.

Hint.
You have
$$ m \ddot x = f(x) = \begin{cases} 5 (6 x-8) & x \le 2 \\ 20 & 2\lt x \le 3 \\ 10 (2 x-4) & x \gt 3 \end{cases} $$
then
$$ m\dot x \ddot x = f(x)\dot x\to \frac m2 \frac{d}{dt}\dot x ^2 = \frac{d}{dt}F(x) $$
then integrating
$$ \frac 12 m (v^2-v_0^2) = F(x) = \begin{cases} 15 x^2-40 x & x\leq 2 \\ 20 x-60 & 2<x\leq 3 \\ 20 \left(\frac{x^2}{2}-2 x\right)+30 & 3 < x \end{cases} $$
Attached the plot for $f(x)$ in blue, the plot for $F(x)$ in red and the plot for $v(x)$ in black showing the points in which $v = v_0$ which occurs at $x = 0$ and $x = 3$