The word rabbi originates from the Hebrew meaning "teacher."
The term has evolved over Jewish history to include many roles and meanings. Today it usually refers to those who have received rabbinical ordination and are educated in matters of halacha (Jewish law). They are the ones knowledgeable enough to answer halachic questions. Most countries have a chief rabbi they rely on to settle halachic disputes.
The state gives rabbis the permission to perform weddings. Technically, you don't need one; however, it's important to have a rabbi to make sure that the complicated marriage ceremony is done properly. Valid witnesses are needed to make the marriage official. The criteria constituting a valid witness differ among the movements. In Israel, a rabbi is needed for the secular legality of the wedding. The purpose of a rabbi is like that of using a judge or a lawyer in civil matters to ensure that the law is complied with. This differs from the nonJewish concept of a minister having some necessary mystical connection with God that is required to make the ceremony valid.
The term rabbi was first used in reference to the rabbis of the Sanhedrin during the first century C.E. Throughout the medieval period the term referred to the common man, while the term harav implied scholarship.
Similar to modern times, many of those with rabbinical ordination in the talmudic period pursued other forms of livelihood unrelated to that of a rabbi. Today many rabbis are simultaneously doctors, lawyers, psychologists, etc. By the 12th century, however, the job of rabbi had become a full-time occupation.
Also similar to modern times, the rabbis of talmudic times had many obligations. They were supposed to determine the Jewish calendar, serve as a judge in the rabbinical court, help ensure a form of social welfare in the community, and try to increase religious observance.
The rabbis of talmudic times were the sole authority on the Oral Torah. (This was before Oral Torah was written, and no one had the opportunity to study the law for themselves). The rabbi was also revered as being a figure closer to God than anyone else in the community. He was thought to have the ability to curse and bless individuals. A rabbi has no actual power under Jewish law. While Catholic priests are often used as intermediaries between man and God, rabbis are nothing more than regular people who may be officially recognized through a process of ordination, or informally by virtue of the respect they have earned for their knowledge and righteousness.
Today the role of a rabbi mirrors that of a Protestant minister. He serves the community as an educator, social worker, preacher, and occasionally conducts prayer services. The rabbi is not required to lead prayer services - any knowledgeable congregant can carry out the service. Catholic priests can give absolution for sins, rabbis can't (unless you're asking forgiveness for something you've done against the rabbi personally).
The Conservative, Reconstructionist and Reform movements began to grant women semicha in the last few decades. Orthodox congregations do not ordain women as rabbis. They follow the stricter interpretation in the Talmud prohibiting women from serving as witnesses or judges.
Sources: Judaism 101, Smith, Jonathan Z., Ed. The HarperCollins Dictionary of Religion. HarperCollins Publishers Inc., 1995 and Wigoder, Dr. Georffrey, Ed. The New Standard Jewish Encyclopedia. Encyclopedia Publishing Co., 1992, Shamash