This is an oft-debated question, one I sometimes ask my students, too. No representative is ever obligated to vote the will of the people, of course, although there are no doubt people who expect this. Personally, I come down on the side of a representative exercising his or her own judgement in any given case, and I find myself quite disturbed by how much poll results have taken over American discourse and decision-making. Certainly, a majority in any given district or state has elected someone, theoretically because of his or her positions on various matters. But for that person to always vote the will of the majority is foolish for many reasons.
First, one of the chief purposes of a democracy, at least in the United States, is to protect the minority, and this does not necessarily happen if representatives always vote the way the majority want them to vote. This has, in the past, resulted in outcomes like segregated schooling and housing.
Second, it is not possible for a representative to always know what the majority wants. Representatives vote on a myriad of legislative matters, not all of which can be "polled" as they arise. While a representative should always have a finger on the pulse of the people, situations arise in which this is not the case.
Third, the electorate, at least in my opinion, is largely staggeringly uninformed on many legislative issues, and while this does not mean that any given representative is as well-informed as I would like, the representative should have far more information about many matters than the electorate does. Concomitantly, a representative sees the "big picture" that the electorate does not usually see, an understanding of the larger implications of choices made. For example, a representative might vote in a way that is advantageous to one particular district, but in a way that is disadvantageous to an entire state.
Fourth, voting by the numbers has some logistic problems in cases in which there is no clear majority. What is a representative to do if half the people want one thing and half want another? Choosing on behalf of the majority is an impossibility.
I believe that we should elect our representatives and pay them to exercise their judgement. Otherwise, we don't really need representatives at all. All matters would be decided by referendum, and this would have outcomes that I don't even want to think about.