Try running the Apple hardware test to rule out hardware issues
http://support.apple.com/kb/ht1509
Note: Be sure to disconnect any external devices, printers, hard drives, scanners, and so on (other than the Apple keyboard and mouse) from your Apple computer before starting up to Apple Hardware Test and running the diagnostic.
To start up your computer in Apple Hardware Test:
Press the power button to turn on your computer.
Press and hold the D key before the gray startup screen appears. If Apple Hardware Test does not start up, see the Additional Information section at the end of this article.
Note: Some Macintosh computers that shipped with OS X Lion support the use of Apple Hardware Test over the Internet. These computers will start up to an Internet-based version of AHT if the hard drive does not contain AHT. An Internet-enabled connection via Ethernet or Wi-Fi is required to use this feature.
It takes a minute or so for Apple Hardware Test to start up and inspect your hardware configuration. While this is taking place, an icon appears on the screen:
When the process is complete, select your language and click the right arrow. If you aren't using a mouse, you can use the up and down arrows to select a language and then press the Return key.
The Apple Hardware Test console appears. You can choose which sort of test or tests to perform:
To perform all of the basic tests, click the Test button or press the "T" key or the Return key.
To perform a more thorough diagnostic test, select the "Perform extended testing" checkbox under the Test button before you click the Test button.
Your test results will appear in the window in the bottom-right of the console.
To exit AHT, click Restart or Shut Down at the bottom of the window.
Additional Information
Apple Hardware Test is included on the DVDs that are shipped with some Macintosh computers. If the copy on your hard drive becomes unavailable, use the DVDs to run Apple Hardware Test.
For Intel-based Apple computers that shipped with Mac OS X v10.5.4 or earlier, Apple Hardware Test is located on the Mac OS X Install Disc 1 and should be included with your computer.
For Apple computers that shipped with Mac OS X v10.5.5 to 10.6.7, Apple Hardware Test is located on the Applications Install Disc 2 and should be included with your computer.
For some Apple computers that shipped with OS X Lion, if Apple Hardware Test cannot be found on the hard drive, an Internet-based version starts up instead. An Internet-enabled connection via ethernet or Wi-Fi is required to use this feature. Some computers that shipped with Lion require a software update to use this feature. See Computers that can be upgraded to use Lion Internet Recovery for more information.
Learn about the language availability of AHT.
The Hardware Profile tab of AHT provides specific information about your computer. To see this information, click the tab, then select a subject area on the left.