Apparently the phone isn't able to correctly read the SIM card. Normally that message would mean the SIM is not active (for instance, another SIM has been assigned to the line), but it sounds like the phone is switching back and forth between normal use and this message.
First, try removing and reinserting the SIM. It could just need reseated. While you're doing this, look for anything loose or broken on the SIM card holder. Take a look at the contacts on the phone that connect to the SIM card, and see if they look bent, loose, or damaged.
If reseating doesn't work and there's no damage, try getting a new SIM. There's normally a cost for a SIM, but if you go to a corporate-owned AT&T store and replace the SIM due to a problem, they'll usually do it for free.
If the problem persists, it may be a device issue. If the phone is in warranty (less than 1 year old if purchased new, less than 90 days if refurbished, and in good condition - if you bought it in December 2010 then it's in warranty as long as it's in good condition) and you didn't see any damage on the SIM card holder, call warranty at 1-800-801-1101. Otherwise, if you have insurance, you can call insurance at 1-888-562-8662.
I am an AT&T employee and the postings on this site are my own and don’t necessarily represent AT&T’s positions, strategies or opinions.