This is a waswasah from shaytan. A person should work to eliminate the showing off without having to stop going to the mosques or Islamic centres. In fact in most cases the prayers of the one who lives close to the mosque is not accepted in the home.