That code indicates that the computer is detecting that the engine is not reaching operating temperature within a reasonable time after startup.
I found the following:
which indicates that there might be a known glitch in the computer on early Mazda3s (2004 was the first year) that can cause P0128. It could still be the thermostat since it's 5 years old but if you were going to take it to the dealer anyway then this might be helpful to mention. Especially if it does warm up within a few miles on most drives.
If it is the thermostat then it's less than a one hour job for anyone with reasonable mechanical skills. If you go this route, OEM thermostats are usually a good recommendation even at slightly higher cost because in many cases they are closer to original spec and will last longer than cheap aftermarket replacements. Some aftermarket brands (such as Stant) are exceptions to this rule, however.
Mazda service bulletin: