This problem occurs to excessive bending in the main logic board that will cause the touch chip to lose contact with the board. Happens when the phone is dropped or bent in a weird way. A common solution is to resolder the chip, or to apply pressure using tape (I don't recommend either method).
Send it to Apple and get it fixed - $150. I HIGHLY recommend not taking apart your device because it'll void your warranty.
I know it seems expensive, but it beats buying a new phone.