I think gluProject is the anwser to your first question.

To check color of the pixel on the screen use glReadPixels function.