Why can't helicopters fly at high altitudes? I recently watched a movie and in the movie it stated that the helicopter could not fly to the top of mt.everest to rescue the person stuck on the top. So why can't helicopters fly at such high altitudes?
Don't believe everything you see in the movies. Doubly so if the movie originated in Hollywood.

The world altitude record for a helicopter is 40,814ft (12440m), some 11,000 feet (3353m) higher then Everest, set in 1972 Reference: Wikipedia

In 2005 Didier DelSalle famously touched down on the summit of Everest in an AS350 Squirrel Reference: Wikipedia. See below for a video.

Both feats involved specially prepared aircraft and highly experienced crew.


                
            

As has already been pointed out, a helicopter, just like any other aircraft, has a ceiling above which they cannot fly. Since it's clear that it is possible to fly helicopters to the required altitude in certain conditions, this is just a red herring.

The real reason helicopters don't routinely fly to those altitudes is that they're not designed to. As with everything in aviation, performance is a trade off between engineering, aerodynamics and commercial pressures. 

There's a big market for helicopters that can fly up to, say, 12-15,000ft (3600-4500m). The market for helicopters capable of rescuing climbers from the top of Everest is, at best, limited, and the technical demands of building a craft routinely capable of such a flight will push the costs up dramatically.

In short, they don't because nobody will pay for it.