Writing and authorship serve several functions that authors need to consider, such as compiling scattered information, clarifying ambiguities, or solving problems, among others. However, a group of Muslim scholars viewed a completely different function: the social function. This means that the purpose of authorship is to provide a service to the community and the nation, not just to students of knowledge. These services vary depending on the issues the scholar views as requiring solutions. Following are three examples to illustrate and explain this point:
First: Imam Abu al-Maali al-Juwayni (d. 478 AH), known as Imam al-Haramain, authored his famous book "Ghayath al-Ummam fi al-Tiyas al-Zulm" based on a premise: What should be done if a time is devoid of scholars and jurists? He addresses the concerns of the nation and provides solutions to this problem that a community might face. This demonstrates a thoughtful approach that serves the community by identifying a problem and proposing a solution. He states: "Let it be clear that the basis for the Sharia is its transmitted sources, and those who bear its burdens are those capable of ijtihad, who embody the highest virtues of piety and righteousness. They are the pillars and supports. If a time were to be devoid of such pillars and supports, then I would adhere to the principle of patience and caution. I wonder what will the devoted do when the sea of corruption swells? When people substitute extremism and negligence for the path of moderation, and Muslims are afflicted with scholars who are unreliable due to their corruption and ascetics who are not to be followed due to their laxity! Will there remain any path to guidance, or will people be lost in chaos, neglecting their direction, and rushing towards ruin?"
Second: The "Hujjat al-Islam" Imam al-Ghazali (d. 505 AH), the student of Imam al-Haramain, who follows the same path. It is likely that this concern for the nation and society was transmitted to him from his teacher. Imam al-Ghazali, when he observed that most people had turned away from the path of the Hereafter and followed their whims and desires, and that their time had deprived them of true inheritors of the prophets, leaving the era devoid of those who guide to Allah, except for whom Allah wills, sought to address this gap. He aimed to correct the course of the nation and Muslim societies through his valuable book "Ihya' Ulum al-Din". The "Hujjat al-Islam" says: "The guides on the path are the scholars who are the heirs of the prophets. The time has been devoid of them, leaving only those who are merely pretenders. Most of them have been overtaken by Satan and misled by tyranny. Each one has become engrossed in his own immediate gains, seeing good as evil and evil as good. Thus, the knowledge of religion has become obscured, and the beacon of guidance on the earth has become dim... As for the knowledge of the Hereafter and what the righteous predecessors practiced, which Allah has described in His Book as understanding, wisdom, knowledge, light, and guidance, it has become forgotten and neglected among the people. Given that this is a serious breach and an alarming issue in religion, I saw it necessary to engage in compiling this book, aiming to revive the sciences of religion, reveal the methods of the early imams, and clarify the benefits of useful knowledge as understood by the righteous predecessors."
Third: Shaykh al-Islam, Imam Taj al-Din al-Subki (d. 771 AH), to address a question that resonates with people and impacts their lives: How can one return blessings after losing them? He discusses the responsibilities of craftsmen, officials, and merchants, and what pertains to each of them. He summarizes this in the introduction to his book "Mua'id al-Ni'am wa Mubiid al-Niqam", saying: "Is there a way for someone who has lost a religious or worldly blessing to regain it? I hope that anyone who has experienced a blessing from Allah in their religion or worldly life and has lost it, if they read this book with belief, understand it, and act upon its teachings after believing in them, will have that blessing or something better returned to them. Their worries will be entirely removed, and they will be transformed into a state of joy and happiness."