Why do Muslims fast on 9th and 10th Muharram?
We fast because it is the Sunnah of our Prophet Mohammad (SWT). He fasted due to the following:
When the Prophet emigrated to Madina he found the Jews fasting on the 10th of Muharram (the 1st month), who in were fasting because their Prophet Moses (AS) fasted in gratitude of Allah for saving him and his followers from the Pharaoh. There upon he started to fast as well and ordered the Muslims to fast too.
When the Prophet came to Medina, he found (the Jews) fasting on the day of 'Ashura' (i.e. 10th of Muharram). They used to say: "This is a great day on which Allah saved Moses and drowned the folk of Pharaoh. Moses observed the fast on this day, as a sign of gratitude to Allah." The Prophet said, "I am closer to Moses than they." So, he observed the fast (on that day) and ordered the Muslims to fast on it. " - Narrated by Ibn Abbas (Sahih Al-Bukhari Hadith - 4.609)
The next year, fasting was made mandatory by Allah in the month of Ramadan - the 9th month - thus the fast for 10th Muharram became non-obligatory yet remained important as the Prophet continued to keep fast on this day outside of Ramadan. He fasted on other days as well but this was one of the days when he recommended others fast too.
أَبِي هُرَيْرَةَ رَضِيَ اللَّهُ عَنْهُ قَالَ
قَالَ رَسُولُ اللَّهِ صَلَّى اللَّهُ عَلَيْهِ وَسَلَّمَ أَفْضَلُ الصِّيَامِ بَعْدَ رَمَضَانَ شَهْرُ اللَّهِ الْمُحَرَّمُ
Abu Hurayrah (may Allah be pleased with him) said: Allah’s Messenger (peace and blessings be upon him) said, “The best time to fast after Ramadan is Allah’s month - Muharram
In the 10th year of his stay in Madina, the Prophet (SWT) said: "If I live, then IA next year I will fast on both 9th and 10th Muharram as we should fast differently from the Jews"
Imam At-Tirmidhi reported that Ibn `Abbas (may Allah be pleased with them both) used to say: We should fast on two days: the 9th and 10th of Muharram to distinguish ourselves from the Jewish community. (At-Tirmidhi, Hadith 686)
As we all know our Prophet (SWT) passed away the same year, so the companions decided to start fasting on 9th and 10th Muharram and later ullema decreed that 10th and 11th are equally correct and they said fasting only on 10th as Makruh (not favourable). However if one is not well or has some other problem then he should fast only on the 10th of Muharram i.e. Ashura, and not leave this all important roza as there is great reward for itThe importance of the fast on this day can be seen from the following hadith (the relevant section has been highlighted):
Someone came to the Apostle of Allah (peace be upon him) and said: How do you observe fast? The Messenger of Allah (peace be upon him) felt annoyed. When Umar noticed his annoyance, he said: We are well pleased with Allah as our Lord, with Islam as our Code of Life, and with Muhammad as our Prophet. We seek refuge with Allah from the anger of Allah and that of His Messenger. Umar continued repeating these words till his (the Prophet's) anger calmed down. Then Umar said: Messenger of Allah, what is the position of one who perpetually observes fasts? Thereupon he said: He neither fasted nor broke it, or he said: He fasted for two days and broke one day. Thereupon he said: Is anyone capable of doing it? He (Umar) said: What is the position of him who observes a fast for one day and breaks it on the other day? Thereupon he (the Holy Prophet)said: That is the fast of David (peace be upon him). He (Umar) said: What about him who observes fast one day and breaks it for two days. Thereupon he (the Messenger of Allah) said: I wish I were given the strength to observe that. Then he said: The observance of three days' fast every month and that of Ramadan every year is a perpetual fasting. I seek from Allah that fasting on the day of Arafah may atone for the sins of the preceding and the coming years, and I seek from Allah that fasting on the day of Ashura may atone for the sins of the preceding year.- Narrated by Abu Qatadah (Sahih Muslim Hadith - 564)
Source: https://www.quora.com/Why-do-Muslims-fast-on-9th-and-10th-Muharram