For about a month no matter what l tried my macbook would start up then either a minute or an hour into it working the screen would go black and it would go into a sleep mode and wouldnt come back on,l switched off al sleep settings and still no difference, then out of nowhere it worked perfectly for another month and now today after 10 mins of working the screen went black and it just come on for 2 secs and goes black again. it seems to be in a perma sleep mode, l just cant understand what the problem is.
l have a 2007 macbook so its getting old but doesnt seem to have any problems loading up or with the hard drive.

any sugestions?