Warning
1. Disconnect the negative battery cable.
2. Remove the liftgate lower upper trim.
3. Press the liftgate harness connector's bracket, which is attached to the liftgate, to the (1) direction shown in the figure, and then detach the fit. Then remove the connector toward the (2) direction shown in the figure.
4. Disconnect the vehicle harness connector and the liftgate connector. Then remove the grommet from the liftgate.

5. Pry away the stay damper's band with a screwdriver.

6. Pry out the connecting part of the stay damper and the hinge with a screwdriver to disconnect them. Then remove the stay damper.
7. Remove the bolts A, then remove the liftgate.
8. To remove the hinge, remove the headliner and the nut.
9. To remove the stay damper, remove the bolt B.

10. Install in the reverse order of removal.
Liftgate
Liftgate disassembly/assemblyMazda 6 Service Manual: Rear View Monitor Operation
The operation of the rear view monitor when reversing the vehicle varies depending
on the traffic, road, and vehicle conditions. The amount of steering and the timing
also varies depending on conditions, so confirm the surrounding conditions directly
with your eyes and steer the vehicle in acc ...
Mazda 6 Service Manual: Cargo compartment light switch inspection
1. Remove the liftgate lower trim. (See LIFTGATE LOWER TRIM
REMOVAL/INSTALLATION)
2. Disconnect the cargo compartment light switch connector.
3. Inspect for continuity between the cargo compartment light switch
terminals using an ohmmeter.
If not as specified, replace the liftgate lock.
...