Hello there, Welcome To Geeks To Go
If your MacBook (13-inch) shuts down randomly during use, a downloadable firmware update is now available that resolves this issue.
It could be downloaded here: Downloadable Firmware Update
Or, You can use the Software feature of system preferences.
MacBooks running Mac OS X 10.4.7 will be able to download and install the SMC Update, so it is not essential that you update your system software, although Apple always recommends updating to the latest version of the system software.
If your MacBook is in a state where it will not remain on long enough to install the update, wait for the issue to reproduce itself. Once the MacBook has turned itself off, turn the computer on by holding the power button down. Keep the button down until you hear a single long tone. Once you hear the tone you can release the button, install the recommended updates, and restart normally.
Hope This Helps.