It is permissible to fast on that day with the intention that it is from Sha'ban. If it turns out to be from Month of Ramadan, the fast suffices; if it is from Sha'ban, it does no harm. However, if someone fasts on that day while in doubt and without proper intention, they must make up that day, even if it turns out to be from Month of Ramadan, because no obligatory acts are accepted without certainty. It is not permissible for someone fasting on the day of doubt to intend it as being from Month of Ramadan.
Commentary #1