My 1997 Mazda sedan starts well, but runs rough. When you accelerate, it dies.
A car like this shouldn’t frighten too many mechanics, largely because this is a fairly simple machine using well-understood technologies. In a situation like this one, most workshops will go back to first principles. That is: Air, fuel and spark.
On the surface, it sounds like a fuelling problem that is causing the engine to run out of fuel when it needs it most (when accelerating). So a check of the fuel filters, the fuel pump delivery pressure and volume and the injectors would be a good place to start. However, stumbling under load can also be caused by poor ignition, so the spark plugs, leads and coil(s) and charging system should also be checked out. Don’t forget things like a dirty air filter which also cause a case of the stumbles.
If all that checks out, then you need to start looking for a dud sensor somewhere in the engine bay. An electronic scan is a must for any electronically-injected car.