Textbook authors often point put that operators aren't in general commutative which is a source of confusion. Another point of confusion, which I haven't seen mentioned anywhere is the issue with associativity.
One might naively perform a calculation like $$\hat{p}\hat{x}\psi(x)=-i\hbar\frac{d}{dx}x\psi(x)=-i\hbar\frac{dx}{dx}\psi(x)=-i\hbar\psi(x).$$ Which is what I did when I was first trying to evaluate this. Because I didn't know operators don't associate like this. No textbook that I know of mentions it and I am probably not the only one who fell into this pitfall.
I am looking for more information about issues concerning operator associativity in QM.
EDIT: Consider a case like this: $\hat{A}\hat{p}\hat{x}$.