Solving $a^3+a^2|a+x|+|a^2x+1|=1$ 
Find all values of $a$ for which the equation $$a^3+a^2|a+x|+|a^2x+1|=1$$ has no less than four different integer solution.

My attempts:
If we rearrange it as $$|a^2x+1|+|a^3+a^2x|=(a^2x+1)-(a^3+a^2x)$$
Hence it requires us to solve following system of equation,
\begin{cases}a^2x+1&\geq0\\\ a^3+a^2x&\leq0\end{cases}
And here I'm paused. Please help
 A: Consider the case $a=0$ separately, because division by $a^2$ will feature in the manipulations that follow. If $a$ is as such, the inequalities reduce to the trivial $1\ge0$ and $0\le0$, so certainly the original equation has at least four integer solutions here.
Now assume $a\ne0$; the first equation can be manipulated as
$$a^2x\ge-1\implies x\ge-\frac1{a^2}$$
and the second as
$$a^2(a+x)\le0\implies a+x\le0\implies x\le-a$$
The two bounds meet when $a=1$ and the lower bound exceeds the upper bound when $a>1$, so solutions for $x$ exist only if $a\le1$. To get the intervals where $x$ has at least four integer solutions, we consider three intervals arising from the partition of $(-\infty,1]$:


*

*$a\in(0,1]$. In this range, $-1$ is a solution for $x$, with lower negative integers appearing as solutions as $a$ approaches 0. We seek the point where $-4$ becomes a solution, which is where $-\frac1{a^2}=-4$ or $a=\frac12$.

*$a\in[-1,0)$. At $a=-1$, there are only three integer solutions for $x$. Above this, the highest integer solution is 0, so we seek the point where $-3$ becomes a solution as $-\frac1{a^2}$ decreases. This point is $a=-\frac1{\sqrt3}$.

*$a\in(-\infty,-1]$. Downwards of $-1$, the lowest integer solution of $x$ is 0. We seek the point where 3 becomes a solution as $-x$ increases: $a=-3$.


Combining these pieces, we see that the original equation has at least four integer solutions when $a\in(-\infty,-3]\cup[-1/\sqrt3,1/2]$.
