That's the 2nd generation Mazda 6 - many of the engine/otherwise issues from the 1st generation were worked out so it's a very reliable car when well taken care of. The biggest issue that I'm aware of for those is the rear subframe rot - there was a recall on it not too long ago because it would completely rust out and become dangerous, but Mazda will fix it so far as I know.
I don't know too much otherwise about that generation, so hopefully someone else can chime in a bit.
I've had my 2010 6 GTi since 2009. Currently has 95k miles on it and it runs great. In that time, it has only had routine oil changes, new tires at 50k, 2 batteries, a couple of alignments, new brakes at 92k (didn't actually need them but I was taking a trip and would be out of town for 3+ weeks).
The only repairs that have been needed were replacing the a/c evaporator (behind dash -expensive labor), and bridging the wires for the left-rear door lock sensor to keep the alarm from sounding repeatedly (easy DIY). The EVAP replacement was probably my own fault for parking under a magnolia tree which drops tons of acidic pollen same leaves. The repair shop said the EVAP was coated with slimy pollen which ate a hole into it. I don't park there anymore.
Of course a lot depends on how well the prior owner(s) maintained and drove it .