Hello your are suffering from obsessive compulsive disorder, every answer I see below is not related to your situation, I have also suffered from OCD. I feel i may get punished because of my irreligious thoughts towards god. en.wikipedia.org/wiki/Obsessive–compulsi... you can also search google for it. you need help whenever you get these thoughts do not care the thoughts or fill the space of those thoughts with another thoughts like doing some work but do not question yourself and answer yourself of you doing it correct or not.
I have been suffering from ocd since my 10th class , so when you feel you are doing some thing wrong do it , you feel you are beating god, then go and kick him in your puja mandir, I know there is a lot of anxiety for you at that time, I suffered for a whole year, with full of anxiety , that led to me to very depressed state for the rest of my years, please if you feel that god will punish you, then raise your leg and kick him in the face , then you see at the spot that no god is punishing you from outside, no god punishes you, if you kick your father , does your father punishes you and kills you, no isn't it right, what I mean to say is just do not pay attention to these thoughts, they will go away, my answer to you is just go and meet psychiatrist with your family. Because they give medicines for a course of time, you will get alright, please be in touch with me for any doubt in regarding your situation, I can help you all the way I can. this you can see in youtube what is suffering from ocd , From today dont be sensitive, my ocd start from having sexual thoughts on goddesses , I felt great suffer and agony for many years, what can I say about my suffering, do not consider those thoughts, spit on gods even if you feel anxiety then you see that there is no thing harming you, not even that ******* god who you are thinking will help you, but you yourself can help you, do not go on with rituals , like that see here what is the suffering of an ocd is like : http://youtu.be/nrRqb5cvM5E