Why my iPhone switches from wi-fi to 3g each time screen blocks and does it take any data during? (or how to check it) I am using iPhone 3gs 16gb with OS 4.0.1 and each time screen blocks it is switching from wi-fi to 3g. It comes back automatically to wi-fi each time I unblock the screen. 

Can I prevent it somehow? I want it to stay connected to wi-fi all the time.

How can I check how much datas it is downloading during?
That is a feature to preserve battery life. If your iPhone is jailbroken, you can install Insomnia from Cydia to keep WiFi active while the screen locks. 

If you want to check your data usage, you can go to Settings >> General >> Usage. There, you can check under "Cellular Network Data" for how much data you have used. You can reset that, then lock your screen for some time, come back and check what has changed.

Hope this helps!