Usage of glDrawPixels()

Can anyone give me a sample program of how i can make use of glDrawPixels().

Just read the glDrawPixels function spec here

It is very simple, the more complicated is to fill to data array which is out of opengl.

How i can make use of OpenGL to do color mapping, given an image and a color look up table ?

You would make a 1D texture.
You also apply a 2D texture to your object which supposidly has the indexing color values.
You need to use shaders. In the fragment shader you sample the textures.

index = float(texture2D(Texture0, gl_TexCoord0.xy));
texel = texture1D(Texture1, index);