The correct answer is A. Mandamus.
A writ of mandamus is a court order that compels a public official to take a certain action or to refrain from taking a certain action. It is used to ensure that public officials comply with the law.
A writ of quo warranto is a court order that asks a person to show by what authority they are holding a certain office or position. It is used to challenge the right of a person to hold office.
A writ of certiorari is a court order that asks a higher court to review a decision made by a lower court. It is used to ensure that the law is applied correctly.
A writ of habeas corpus is a court order that asks a person to be brought before a court so that the court can determine whether they are being held lawfully. It is used to protect people from being held in prison without being charged with a crime.
In the case of an official who is taking an action which he is officially not entitled, a writ of mandamus can be used to prevent the official from taking the action. This is because a writ of mandamus is a court order that compels a public official to take a certain action or to refrain from taking a certain action. It is used to ensure that public officials comply with the law.