Macbook randomly logging me off

A colleague of mine just had a similar problem last week. After extensive checking (even running Memtest86) it turned out that there was a problem with the filesystem.

To check, boot with your Snow Leopard installation DVD and run the Disk Utility to check the filesystem. If it does find errors, don't bother trying to repair the errors with Disk Utility, in my experience it can't repair anything. Instead, buy DiskWarrior and use that for repairing your filesystem. It saved me two weeks ago and my colleague last week, so while it's expensive it really is a life-saver, IMHO (no, I'm not affiliated with them in any way).