Most basic way of staying safe is, "If it sounds too good to be true, it probably is a scam."
1) Legitimate companies do not send you money BEFORE you shop (with a very few negotiated exceptions with shoppers with a long time history with the company)
2) Fees tend to be in the $5 to $20 range for your work
3) If someone contacts you 'out of the blue' to do mystery shops, it likely is a scam.
4) To shop you need to register with a company with their on line presence--most scammers would have you send your personal information by email.
5) No legitimate company is going to send you a check, tell you to take out your fees and expenses and then wire transfer the balance on to the 'next shopper'.
Mafia_Princess is absolutely correct that scammers use the names of legitimate companies, knowing that folks are likely to do a Google search and find the real company out there so fall for the scam.
If you receive a check, do not deposit it. Initially it will look good but when presented on the other end will be disowned by the company on whose account it was forged. It will come back to you as a bad check and you will be charged bounced check fees in addition to needing to replace any of that money which you may have withdrawn.