Let $P(n)$ be the statement that $x^3+x\equiv a\pmod n$ is solvable for all $a\in\{0,1,2,\ldots,n-1\}$ (the case $a=0$ is uninteresting, but I include it anyway).
Clearly $P(n)$ is false whenever $n$ is an even number because $a^3+a$ as well as its remainder will then be even for all $a$.
Let $p>3$ be a prime number. My next goal is to prove that $P(p)$ fails. Consider the set $S$ of residue classes of $-4-3a^2$ modulo $p$, with $a$ again ranging over $\{0,1,\ldots,p-1\}$. We see that the congruence (all modulo $p$ for now)
$$-4-3a^2\equiv-4-3b^2$$
holds if and only if $a^2\equiv b^2$. This happens if and only if either $a\equiv b$ or $a\equiv-b$. It follows that the set $S$ contains exactly $(p+1)/2$ residue classes: the choice $a=0$ yields $-4\in S$, and the rest of the choices for $a$ pair up in the sense that $a$ and $-a\equiv p-a$ yield the same element to $S$.
The exact same argument shows that the set $Q$ of residue classes of squares modulo $p$ also has exactly $(p+1)/2$ elements.
As there are exactly $p$ residue classes altogether, it follows that the sets $S$ and $Q$ necessarily intersect. In other words, there exists a pair of integers $a,b\in\{0,1,\ldots,p-1\}$ such that
$$-4-3a^2\equiv b^2.$$
Time to get to the actual problem! Let $a$ and $b$ be some pair of integers satisfying the above congruence. We have the factorization (this holds for all $a$)
$$
x^3+x-(a^3+a)=(x-a)\left(x^2+ax+[a^2+1]\right).
$$
Look at that quadratic. Its discriminant
$$
D=a^2-4[a^2+1]=-4-3a^2\equiv b^2
$$
is a square, so we know that it factors modulo $p$!
More precisely, from the quadratic formula it follows that
$$
x^3+x-(a^3+a)\equiv(x-a)(x+\frac{a+b}2)(x+\frac{a-b}2),
$$
where division by $2$ is carried out "modulo $p$".
This means that the remainders of $x^3+x$ at the choices $x=a$, $x=(-a+b)/2$,
$x=(-a-b)/2$, the three roots of that cubic, are all equal. In other words, the same remainder occurs at least twice. Therefore $P(p)$ is false.
Of course, when $P(p)$ is false, it follows that $P(m)$ is false whenever $m$ is a multiple of $p$. The conclusion is thus that $P(n)$ can only be true, when $p=3$ is the only prime factor of $n$.
Adding a proof for the fact that $P(3^k)$ holds for all $k\ge1$.
Let $a,b$ be any integers. Let $f(x)=x^3+x$. As above, we have the factorization
$$f(a)-f(b)=(a-b)(a^2+ab+b^2+1).\qquad(*)$$
It is easy to show that $a^2+ab+b^2+1$ is never divisible by three. We can either test all the nine cases, or observe that
$$a^2+ab+b^2+1=(a-b)^2+1+3ab\equiv (a-b)^2+1.$$
As $2\equiv-1$ is not a quadratic residue modulo $3$, the claim follows.
The rest is easy. Fix a natural number $k\ge1$. As $3\nmid a^2+ab+b^2+1$, it follows that $3^k\mid [f(a)-f(b)]$ if and only if $3^k\mid a-b$. That's exactly the condition we need to show that $f$ permutes the residue classes modulo $3^k$ as prescribed.