All perfect praise be to Allaah, The Lord of the Worlds. I testify that there is none worthy of worship except Allaah, and that Muhammad is His slave and Messenger.
Pleasing one's parents and obeying them in all what does not contradict Islam is an obligation on all Muslims. In fact, Allaah has allotted the parents great rights over their children. He has linked their rights to His right in many verses in the Qur'an. So, pleasing one's parents is part of pleasing Allaah as narrated in a sound Hadeeth that the Prophet said: “The Pleasure of The Lord is in the pleasure of the parents and The Anger of The Lord is in the anger of the parents”.
The scholars explained this Hadeeth by saying that Allaah has Ordered Muslims to obey their parents and do their best to please them. So, whoever does that he has obeyed Allaah's Orders, hence pleasing Him. Similarly whoever angers them angers Allaah and will be punished by Him.
As for saying that the good deeds of the one who disobeys his parents are not accepted, we did not find any evidence about this that. However, we believe that the Hadith cited above is enough evidence for the great status of the parents and the utmost importance to please them and not anger them.
But, as we mentioned earlier, one should not obey his parents if they tell him to do something that is not in conformity with the Orders of Allaah. Allaah Says (what means): {But if they (both) strive with you to make you join in worship with Me others that of which you have no knowledge, then obey them not, but behave with them in the world kindly, …} [Quran 31:15].
So, if your mother obstructs you from going to the mosque without a sound reason, you should not obey her. But, you should explain to her your stand politely and wisely. But if she has a sound reason for preventing you from going to the mosque like fearing some probable risks, then you should obey her as there is no contradiction then between her order and Allaah's Commands.
Allaah Knows best.