Are you sure you have a legit copy of Windows 7? As in it wasn't used in a previous prebuilt or in conjunction with another motherboard if it's an OEM verision? Did you buy it from a legit source (ebay NOT legit)?
Other than that, it sounds like you could have multiple problems. We really need a list of your components to give specific help. The BSODs are likely to be issues with the RAM (either the sticks themselves or the settings in BIOS). The random restarts could be overheating or PSU problems, just a problem with the board. We really have no way to tell for sure without knowing the specs and mroe details...
What about your PSU and GPU? Also, we need more info on the RAM. I can think of six sets off the top of my head that could match "G.Skill 2x2 GB 1600 mhz".
It's not just where you buy the OS that makes it legit. I have no doubt that it was originally good. Have you installed it using that key on any other computer?
So far, I'm not seeing any compatibility issues. Can you not get into the OS at all? Is not, I'd install a temporary free OS (like Ubuntu) to run some stability tests in. Start with Prime95 and a temperature program (like RealTemp). Let these run for an hour or more. Come back with the max temperature.
Then download MemTest86+ from memtest.org. Burn it to CD. Restart the build, set the RAM to the exact manufacturer's settings in BIOS and boot from the disc. Then let this run overnight.
You're missing one critical component in your hardware description. What power supply do you have? We also need to know the exact model of RAM you have. There are quite a few G.Skill DDR3 1600 kits out there with different timing and voltage ratings. The RAM should have a sticker on the side that lists the model number, timings, and voltage. You should manually set the RAM speed, timings, and voltage to their rated values in the BIOS.
What are your idle/load CPU temps. I'm guessing you know since you're "very sure" it's not an overheating issue.
1.the model of the ram is F3-12800CL9D-4GBNQ
2. i have changed the bios to auto and to manual with 9-9-9-24 and 1600
3. the psu is Rosewill Xtreme Series RX750-S-B 750W
4. the os key has never been used before
Well, that PSU is not a good quality unit. That could possibly be causing the shut downs, but it certainly wouldn't be causing the BSODs or the OS problem. The BSODs is likely to be the RAM, which may be fixed by the manual settings.
I'd probably try to reinstall the OS and see if the OS errors go away. If they don't, I have no idea what's going on with that...