What is the role of a Rabbi? When this question was asked to Rabbi Yechiel Michel Epstein, author of the monumental code of law the Aruch Hashulchan, he responded that it is to issue rulings on Jewish law. Such is what one might expect coming from a world class posek, decisor of Jewish law.
This would seem to have its roots in last week's parsha, where the Torah describes the role of the Sanhedrin. "If a matter of judgment is hidden from you... you shall come to the judge who will be in those days". A rabbi is, first and foremost, an expert in Jewish law and it is his role to interpret and teach it to the masses.
When this question was asked of Rav Chaim Soloveitchik, one might have expected the response that the rabbi's role is to teach Torah, he being the greatest expositor of Talmud of his generation (and many others), abd ushering in a "new method" of Talmud study. Yet Rav Chaim understood that teaching was a secondary role of the rabbi. He responded that the role of the rabbi is to help the poor, the widow, and the orphan. More important than opening the Gemara is knowing when to close it. If you want to focus on learning, the rabbinate is not for you. But if you want to help people, then your calling may very well be the rabbinate. The stories told of Rav Chaim's compassion and concern for others are legendary. His insistence on ensuring that the poor be given the same respect as the wealthy is a most simple concept, but one very few actually practice, and even fewer are willing to fight for--even at the risk of raising the wrath of the influential.
While Rav Chaim is often revered for his Talmudic genius, it could be that his true greatness lay in his compassion towards all. Jewish women who had children out of wedlock would "leave" their babies at the home of Rav Chaim, knowing full well that he would ensure the baby was well taken care of--and the mother wasn't driven out of town.
"It shall be, if the wicked one deserves to be beaten, the judge shall cause him to lie down...forty [times] he shall strike him" (Devarim 25:2-3). Part of the (theoretical) system of punishment in the Torah is lashes. And the Torah is quite clear that when administrating such, we are give 40 lashes. Yet the rabbis interpreted the verse to mean that only 39 lashes are to be given.
"Raba said: How dull-witted are those other people who stand up [in deference] to the Scroll of the Torah but do not stand up [in deference] to a great personage because, while in the Torah scroll forty lashes are prescribed, the rabbis come and [by interpretation] reduce them by one" (Makkot 22b).
The role of the rabbi is to reduce suffering. And while the difference between 39 and 40 lashes may not seem like much, we must do what we can. Sometimes we can relieve others of much suffering, and sometimes there is very little that can be done. Yet the truly great do all they can, even if they can only do very little.
It is no wonder that the mitzvah immediately following this in the Torah is that of Yibum, the tragic case where a husband passes away leaving a widow, but no children. The Torah strongly suggests that the deceased brother marry his widowed sister-in-law, bringing a small measure of comfort to the family.
Whether rabbis or not, we fulfill our role by reducing the suffering and increasing the joy of others.
 Like other Torah punishments, the technical requirements of giving lashes made such something more on the books that put into practice. Yet in the case of lashes, it was not uncommon for people to desire such. The Talmud teaches that one who received lashes would be absolved from the Heavenly penalty of karet, excision. There is even a custom quoted in the Shulchan Aruch that the gabbai of the shul administer lashes on erev Yom Kippur. While such are not true lashes and may not absolve one of karet, the custom reflects the deep belief of Jews that suffering is a form of atonement.