It is narrated from Sayyiduna Abdullah bin Abbas (may Allah be pleased with them both) that in the Time of Ignorance a woman used to circumambulate the House of Allah naked, with only a small piece of cloth over her private part, and she would recite this verse of poetry:
'Al-yawma yabdu ba'duhu aw kulluhu, fa-ma bada minhu fa-la uhilluhu'
(Today some of it or all of it will show, and whatever of it shows, I do not make it lawful.)
So this noble verse was revealed: "Say: Who has forbidden the adornment of Allah?" [Surah al-A'raf: 32]
Imam al-Shafi'i (may Allah have mercy on him) narrates that the Messenger of Allah (peace and blessings be upon him) said: "None of you should pray in a single garment in such a way that no part of the garment is on his shoulder." This statement of the Messenger indicates that it is not permissible for anyone to pray without clothing when he is able to have any clothing at all.
Hadith Referenceالسنن الكبرى للبيهقي / كتاب الصلاة / 3203