1. Download OS X Mavericks from the Mac App Store, if you haven’t already. If it tries to start the installation, just close it.
2. Insert your USB drive (you’ll need one that’s 8GB or larger) and open Disk Utility.
3. Select your drive in the sidebar and go to the Erase tab. Format the drive as “Mac OS Extended (Journaled)” and name the drive “Untitled.” (Note: if you already have a drive or partition named “Untitled” connected to your computer, name it something else and change the corresponding variable in step 5’s terminal command, or you might experience data loss!).
4. Click the Erase button and wait for Disk Utility to finish.
Your 8 GB USB drive should be called Untitled and formatted as Mac OS Extended (Journaled). The installer should be called Install OS X Mavericks.app and should be in your Applications folder.
5. Close Disk Utility and open up a Terminal window. Copy and paste this command* into the Terminal:
sudo /Applications/Install\ OS\ X\ Mavericks.app/Contents/Resources/createinstallmedia --volume /Volumes/Untitled --applicationpath /Applications/Install\ OS\ X\ Mavericks.app --nointeraction
Press Enter. The process should take about 20 minutes, so don’t cancel it or eject your USB drive while it’s doing its thing.
You should see something like this:
Erasing Disk: 0%... 10%... 20%... 100%...
Copying installer files to disk...
Making disk bootable...
Copying boot files…
6. When it’s done, you should get a message stating the process is finished. Now, you can restart your computer, hold the Option key to access the boot menu, and select your new USB drive. From there, you can launch disk utility, format your drive, and do a clean install of Mavericks.
You can then boot up from the USB by holding down the option key, then install the Mavericks from the USB.
Note that this will also install a recovery partition.
* From tywebb13 post on http://forums.macrumors.com/showpost.php?p=18081307&postcount=3