What is the ruling, if a person is in sexual impurity and offers salah in congregation, noting that he did so because he was too embarrassed to tell his colleagues that he is in the state of impurity?
All perfect praise be to Allah, The Lord of the Worlds. I testify that there is none worthy of worship except Allah, and that Muhammad is His slave and Messenger.
This person had made a great mistake and committed a grave major sin by deliberately performing the prayer while in a state of impurity. Therefore, he must sincerely repent to Allah a sincere repentance that fulfills all its conditions: he must abandon this sin, regret having done it, and be determined not to do it again.
As regards being ashamed of the people, then this is a blameworthy shame, as Allah is more deserving to be ashamed of. This is not an excuse for committing this grave major sin.
In any case, repentance wipes out previous sins and a person who repents from sin is like the one who has not committed a sin, as confirmed from the Prophet .
Allah knows best.
You can search for fatwa through many choices