All doors lock automatically when the lock side is pressed. They unlock when the unlock side is pressed.
Driver's door

Front passenger's door

To lock all the doors from an open front door, press the lock side of the door lock switch and then close the door.
NOTE
When locking the doors this way, be careful not to leave the key inside the vehicle.
Locking, Unlocking with Transmitter
Auto Lock/Unlock FunctionMazda 6 Owners Manual: Ignition switch inspection
1. Disconnect the negative battery cable.
2. Remove the column cover. (See COLUMN COVER REMOVAL/INSTALLATION)
3. Disconnect the ignition switch connectors.
4. Inspect for continuity between the ignition switch terminals using an
ohmmeter.
If not as specified, replace the ignition switch.
...
Mazda 6 Owners Manual: Combination switch removal/installation
1. Disconnect the negative battery cable.
2. Remove the driver-side air bag module. (See DRIVER-SIDE AIR BAG MODULE
REMOVAL/INSTALLATION.)
3. Remove the steering wheel. (See STEERING WHEEL AND COLUMN
REMOVAL/INSTALLATION.)
4. Remove the column cover. (See COLUMN COVER REMOVAL/INSTALLATION)
5 ...