Abu Hurayrah (may Allah be pleased with him) said: "The Messenger of Allah (peace and blessings of Allah be upon him) said: 'The best of fasting after Ramadhan is fasting Allah's month of Muharram.' " [Reported by Muslim, 1982]
The phrase "Allah's month", connecting the name of the month to the name of Allah in a genitive grammatical structure, signifies the importance of the month. Al-Qari said: "The apparent meaning is all of the month of Muharram." But it was proven that the Prophet (peace and blessings of Allah be upon him) never fasted any whole month apart from Ramadhan, so this hadith is probably meant to encourage increasing one's fasting during Muharram, without meaning that one should fast for the entire month.
It was reported that the Prophet (peace and blessings of Allah be upon him) used to fast more in Sha'ban. It is likely that the virtue of Muharram was not revealed to him until the end of his life, before he was able to fast during this month. [Sharh an-Nawawi 'ala Sahih Muslim]