Is a woman`s prayer considered invalid if non-Mahrams (marriageable men) saw her offering it?
A woman`s prayer isn`t invalidated if non-Mahrams saw her offering it, but she had better pray in isolation.
What is the ruling on the cessation of blood after (40) days from delivery, but later continued sporadically during two days of Ramadan?
Once postpartum bleeding (Nifas) ceases, and the woman is certain that it won`t reoccur, then she becomes ritually pure and so she is free to make Ghusl (purificatory bath), pray, and fast. If the bleeding reoccurs before fifteen days from its cessation, and before the end of (60) days after delivery, then the ruling on postpartum bleeding is effective, and her fasting and prayer are null and void, thus she must make up the fasting that she missed and not the prayer during those particular days.
What is the ruling on wiping the white area behind the ears instead of wiping the head?
The obligation in ablution is to wipe some of the head; it is not a condition to wipe all of it. Wiping the white area behind the ears suffices for that. And Allah the almighty knows best.
Is it correct that everything dry is pure even if it has impurity on it?
If something impure becomes dry, it remains impure and is not purified by drying. However, the impurity does not transfer by touching it if the one touching it is also dry. And Allah the Almighty knows best.