Test the proximity switch by doing the following...
Lock the screen but make sure it is lit up (press one of the buttons to light up the screen), then press...
Home, Back, Back, Home, Back, Home, Home, Back
Go to Service tests the go to Proximity switch
Now put the phone to your ear and you should hear a short tone, then move it away and you should hear a beep. Alternatively you can put your finger in front of the proximity switch (located next to the ear piece on the right), and you should see it it switch to On when you cover it, and Off when you remove your finger (as well as the tone and beep).
If it does as described above, then the proximity switch it working, if not, it's broken