Is it valid to observe i’tikaaf in any mosque?
Question

Is it valid to observe i’tikaaf in any mosque?.
Praise be to Allah.The scholars differed concerning the characteristics of the mosque in which it is permissible to observe i’tikaaf. Some said that it is valid to observe i’tikaaf in any mosque, even if prayers in congregation are not held there, based on the general meaning of the verse in which Allah says (interpretation of the meaning): 
“And do not have sexual relations with them (your wives) while you are in I‘tikaaf (i.e. confining oneself in a mosque for prayers and invocations leaving the worldly activities) in the mosques”
[al-Baqarah 2:187]
Imam Ahmad was of the view that it is conditional upon it being in a mosque in which prayers are held in congregation. He quoted the following evidence for that: 
1 – The words of ‘Aa’ishah: “There should be no i’tikaaf except in a mosque in which prayers in congregation are held (masjid jamaa’ah).” Narrated by al-Bayhaqi, classed as saheeh by al-Albaani in his essay Qiyaam Ramadaan. 
2 – Ibn ‘Abbaas (may Allah be pleased with him) said: “There should be no i’tikaaf except in a mosque in which prayer is established.” Al-Mawsoo’ah al-Fiqhiyyah, 5/212. 
3 – If a person observes i’tikaaf in a mosque in which prayers in congregation are not held, this will lead to one of two things: 
(i)Either he will miss prayer in congregation, and it is not permissible for a man to miss prayer in congregation without a valid excuse.
(ii)Or he will go out a great deal in order to pray in another mosque, which defeats the purpose of i’tikaaf.
See al-Mughni, 4/461. 
Shaykh Ibn ‘Uthaymeen said in al-Sharh al-Mumti’ (6/312): 
I’tikaaf is not valid unless it is observed in a mosque in which people gather (to pray)?
Is what is meant a mosque in which Jumu’ah prayers are held, or one in which prayers in congregation (jamaa’ah) are held? 
The answer is: a mosque in which prayers in congregation are held; it does not have to be one in which Jumu’ah prayers are held, because the mosque in which prayers in congregation are not held is not a mosque in the true sense of the word, such as if the mosque has been abandoned by its people or they have moved away. 
It is not essential that the mosque be one in which Jumu’ah prayers are held, because Jumu’ah does not happen repeatedly and going out to attend Jumu’ah does not affect i’tikaaf, unlike the five daily prayers which happen repeatedly every day and night. 
This condition – that the mosque be one in which prayers are held in congregation – applies if the person observing i’tikaaf is a man. If it is a woman, her i’tikaaf is valid in any mosque, even if it is one in which prayers are not held in congregation, because prayer in congregation is not obligatory for woman. 
Ibn Qudaamah said in al-Mughni: 
A woman may observe i’tikaaf in any mosque; it does not have to be one in which prayers are held in congregation, because that is not obligatory for women. This is the view of al-Shaafa’i. 
Shaykh Ibn ‘Uthaymeen said in al-Sharh al-Mumti’ (6/313): 
If a woman observes i’tikaaf in a mosque in which prayers are not held in congregation, there is nothing wrong with that because she does not have to pray in congregation.