Let X be a random variable and $A$ a Borel set.
I want to prove $$\int_AXd\mathbf P=\mathbf{P}(A)\mathbb EX$$
and this is how I did this:
$$\int_AXd\mathbf P=\int\mathbf1_AXd\mathbf P=\int\mathbf1_Ad\mathbf P\cdot\int Xd\mathbf P=\mathbf{P}(A)\mathbb EX,$$
but I'm not sure if this is right. Namely, do I need to have any additional assumptions about the set $A$ in order for the second equality to hold? E.g. the $A$ can't be in $\sigma(X)$?
This is false. Your mistake is in thinking that $EXY=EXEY$ always.
For a counter-example take $X$ with standard normal distribution and $A=\{X>0\}$. Then $EX=0$ but $\int_A XdP>0$.
Your argument is correct if $A$ is independent of $X$.