Welcome to Just Answer. My name is XXXXX XXXXX I will be glad to assist you.
You will first need to verify that there is NO aftermarket remote start/alarm system installed under the dash drivers or passenger side. Inspect the fuse box, under the glove box, for any additional aftermarket wires added into the factory wiring harness and remove ALL!!
It that does not resolve the concern, I suspect that you have a faulty hood switch or door ajar switch.
If this concern is intermittent, you may have to have the Mazda dealer connect to the computer and read the data that was stored causing your alarm to sound. (usually a door switch)
You can also inspect all the door ajar switches and verify that each one will turn the dome light on/off with door open/closed.
Also make sure all doors lock/unlock with the power locks switch and key fob transmitter.
Replace any faulty parts. Please let me know if you have any additional questions by hitting the reply button. ThanksDrew
I put a new battery in it and the dealer checked it the last time I was in and charged me for it. He even kept it overnight and monitored the battery power. Thus is why I don't understand what is going on. I put a new battery in the remote alarm key.