Is prayer nullified by having thoughts while performing it?
Prayer isn`t nullified by having thoughts while performing it, provided that the praying person offers all of its pillars and meets all of its conditions. However, the reward decreases significantly in the absence of reverence since a praying person is rewarded according to the attentiveness of his/her heart during prayer.
Is it permissible for a woman to visit the doctor while in her `Iddah (waiting period)?
It is permissible for her to do that during day time, but it is impermissible for her to leave her house at night except for a sound reason. And Allah Knows Best.
Is wearing a cap permissible for boys, or girls?
All Perfect Praise is due to Allah, The Lord of The Worlds.
In principle, anything is permissible sol long as there is no Sharia evidence prohibiting it, thus wearing the cap by boys is permissible as long as it isn`t done in imitation of the disbelievers. Moreover, a Muslim woman should avoid all that which attracts the attention of men because whatever leads to the forbidden is forbidden. And Allah Knows Best.
What is the difference between Tahajjud prayer and night prayer, and do they have a particular Witr prayer other than that of Isha (evening prayer)?
Tahajjud and Qiyam-Al-Lail (night prayer) are two words for the same meaning which is offering voluntary prayer at night after sunset, but before dawn break. However, Tahajjud is offered after waking up; whereas, Qiyam-Al-Lail is permissible before sleeping, or after it. Therefore, every Tahajjud is a Qiyam, but not every Qiyam is a Tahajjud. Moreover, there is no specified Witr for both of them, but Witr after Isha is by itself the Witr of Qiyam, and it is a Sunnah to postpone it until after Qiyam if the worshiper thought that he was most probably going to wake up in order to offer it, but if he wasn`t sure of waking up, then he is at liberty to offer it before going to bed as was reported in the Prophet`s Hadith.