My iphone 4 keeps freezing? What do i do?

I bought this phone on amazon about 5 days ago, it is used but it didn;t have any marks or scratchies and worked like brand new. So Its been working perfectly until this after noon when it started just freezing on what ever i was on and not taking any commands and then It would restart allby itself. After it would restart it would go to the "slid to unlock" thing and would be frozen there. Then It would restart againg and then it would work for like 2-5 min before the process repeats all over again.

No it does not have a full memory. I don't even have any apps downloaded to it. It is no where even near having a full memory.

So what do I do? Please help! And I will choose a best answer… >-<

I would take it to the apple store or you can try restoring the phone on itunes i did that and it fixed my phone but save all pictures and contacts first. http://www.wikihow.com/Restore-an-iPhone that's a link on how to restore it. Hope this helps.