Why won't my iphone send or receive texts?

I have just bought an iPhone off my friend. I also have free texts. It sometimes says that I have signal and other times says that I don't have any. But whenever I try and send a text they won't send. I also don't receive any messages either. Does anybody know why this is happening?

'Check the settings in it as texting may be switched off
or it could just be down to a bad signal