Muslims are encouraged to fast the Day of Ashura by the Prophet Muhammad (SAW).

“I never saw the Messenger of Allah (peace and blessings of Allah be upon him) so keen to fast any day and give it priority over any other than this day, the day of ‘Ashura’, and this month, meaning Ramadhan.
Hadith | Sahih al-Bukhari
The scholars of Islam consider it recommended to fast on the 9th of Muharram along with the 10th of Muharram (‘Ashura). This is due to the Hadith:

When the Messenger of Allah (pbuh) fasted on the day of ‘Ashura and told the people to fast, they said, “O Messenger of Allah, this is a day that is venerated by the Jews and Christians.” The Messenger of Allah (pbuh) said, “Next year, if Allah wills, we will fast on the ninth day.” But by the time the following year came, the Messenger of Allah (pbuh) had passed away.
(Muslim)
The Prophet (pbuh) wanted to fast on the 9th, to differ from the People of the Book.