Yeah, you probably wanna take that to an Apple store for evaluation.
Just now my lock button stopped working, everything else is fine, except that button doesn't work anymore... what the heck??!?!
Out of warranty now, so not taking it to them lol
Even out of warranty you can get it replaced for as little as $200.
I've seen that button die fairly often. If the phone has ever gotten any moisture inside, that part is very vulnerable to moisture damage due to it's design. Just a drop of water or sweat getting into the power button can cause it to fail - so pushing the button with a finger wet from the rain could easily start the failure.
In a 3G or 3GS, it's also subject to stress damage. If the black plastic on the case is only slightly separating from the metal bezel in the top right corner, it's stretching the cable.
If you're not adverse to disassembling the phone yourself, you can pick up a replacement assembly for about $15.00. I've never done it on an original iPhone, but for the 3G plastic-back models, it's a ribbon cable assembly that includes the sleep switch, the headphone jack, the volume buttons, and the mute switch. It's easier than it sounds. I've replaced several.
Jam08 - thanx for the tip, weird thing I noticed now, edge and 3g show no bars but still work, I can still stream music on 3g.. however, text isn't working, can't send msg's. And I'm afraid to let the phone die to reset it as I won't be able to turn it back on.
I've purchased several parts, including that assembly, from CNN.cn before and haven't had any issues - other than the 10 - 15 business day shipping time.
Same problem with my iPhone 4. The only way the button would work is if you pressed it hard against something. Went to the Apple Store and got a replacement