Smoke detectors have a lifespan of about seven to 10 years under normal conditions, possibly less in dirty, oily places or places subject to a lot of vibration. If you've changed the battery and it still won't stop beeping, there are some things you can try before you pitch the old smoke detector and buy a new one.
Check the manufacturing date on the detector. Read the manual to see if there is a special warning or some feature associated with the incessant beeping. If you don't have the manual, do an Internet search. Many manufacturers post downloadable copies of their product manuals online.
Look up the manufacturer's information about the lifespan of the detector. Many will beep every 30 seconds or so, once they pass their service life. If this is the case, you have to replace the unit. It's a good idea to replace all smoke detectors in the house at the same time for safety's sake.
Purchase fresh alkaline batteries if the smoke detector is still within its service period. Most smoke detectors recommend alkalines over regular or heavy duty batteries and they may beep if you don't use the right batteries.
Disconnect a hard-wired detector from the power by flipping off the circuit breaker. Wait a minute or so and then turn the power back on to see if the unit resets itself and stops beeping.
Check to see if your smoke detector has a reset button in addition to the test button. Try holding down both for 30 seconds to see if the unit resets.
Clean out the unit with an aerosol computer duster to remove any dust. Dust on the detector plates or in the unit around the detector can set off the alarm. As long as you are doing maintenance on the detectors, it's a good idea to thoroughly blow the dust out of the unit. This helps prevent the alarm from going off unnecessarily.
If all else fails, call the manufacturer's technical support line. The tech guy may have some tips for shutting off the beeping that isn't in the manual.