I'd heavily suggest against removing the negative battery cable. This not only resets the cel, the FFD data, and the pending codes...but it also resets your LFT's to default values, as well as killing your readiness tests for X amounts of drive cycles and Y amount of mileage. (You'd fail an emissions test).
Pulling the negative battery cable is just a cheap fix to the real problem of trying to figure out what's wrong. It's like trying to fix a wound in your leg by cutting off the leg.
The correct procedure is to get the car scanned. You can do this in the following ways...
1) Take the car to a dealership. As long as you don't have excessive mods on the vehicle, or if the problem isn't caused by a mod, you won't be charged.
2) Take the car to a local autozone (PLEASE CALL FIRST). Make sure to verify that they have a CAN CAPABLE scanner! (Tell them OBD-II isn't sufficent). They'll let you rent the tool to scan your own car.
3) Go to a mazda6 meet where a local member has a scanner you can utilize. Many 6 owners have scanners available, so make a friend!
4) Buy a scanner.
#4 I actually consider a prerequisite to modding. Before any modding on any new car, you should really have the capability to do your own diagnosis and troubleshooting...which means you need a scanner, and a workshop manual. Of course these don't look cool on mod lists, so nobody ever buys them.
Two examples of good scanners to get.
Standalone
AutoXray
http://www.autoxray.com/
Laptop Based
Autoenguitity
http://www.autoenginuity.com/
Of the two, the autoenguitity is far more advanced and feature filled...but it requires a laptop to utilize. The autoxray fits in your glove box as a standalone unit.
Remember if a cel is caused by a mod, or you're out of warranty...its about 90 dollars to check a cel. Two weekend's ago, I scanned 9 cars at the track. The Value of the unit's adds up incredibly fast.