Dividing by a negative number is the same as dividing by a positive number and then multiplying by $-1$. Dividing an inequality by a positive number retains the same inequality. But, multiplying by $-1$ is the same as switching the signs of the numbers on both sides of the inequality, which reverses the inequality:
$$
\tag{1} a\lt b\quad\iff -a\gt -b.
$$
You should be able to convince yourself why the above is true by looking at the number line and considering the various cases involved.
Seeing why (1) is true is not too hard.
Here is the hand waving approach I suggested above:
Consider, for example, in (1), the case when $a$ is negative and $b$ is positive.
We have $a<b$. Then $-a$ is positive and $-b$ is negative. Thus, we have $-b<-a$.
As another case, suppose $a$ and $b$ are both negative with $a<b$. Switching the signs here
makes the resulting numbers both positive with $-a>-b$ (you can see this by drawing the points on the number line and noting that with the given conditions, $b$ is closer to the origin than $a$):
).
The other cases can be handled similarly.
But, perhaps a bit of rigor is needed here.
Recall that
$$a<b\quad\text{ if and only if }\quad b-a\quad \text{ is positive.}$$
Now, $b-a$ is positive if and only if $(-a)-(-b) =-a+b=b-a$ is positive. So
$a<b$ if and only if $-a> -b$.
As said in the comments, you may keep both branches of the $\pm$ when you substitute for both $x$ and $dx$. As both $dx$ and $x$ have the same sign (regardless of what branch you take), they result in the same sign on the answer.
However, an easier way of solving this problem is to write $u=-x^2$ and $du=-2x$. This gives:
$$4\int xe^{-x^2}dx=\frac{-4}{2}\int e^udu=\frac{-4}{2}e^u+C=-2e^{-x^2}+C$$
Best Answer
When we write $-x^2$, it means we square $x$ first, then take the negative of this. That is, $$-x^2 = -\left(x^2\right).$$ So $$-1^2 = -\left(1^2\right)=-1.$$ (And thus $-x^2$ means something different to $(-x)^2$.)