My wife's ears are too small for the hockey puck earphones that the new iPhone comes with, but she wanted their functionality, just with in-ear earbuds. So I cut the heads off some Skullcandy earbuds and spliced them onto the iPhone earphone wires.
Something sharp. I used the knife on my multitool, but scissors or wirecutters would work just fine.
Something hot. A soldering iron or heatgun might work, but I used a torch-style butane lighter.
Step 1: Decapitate In-ear Earbuds
Just what it sounds like. Cut the heads off about an inch and a half from the buds. Leave at least half an inch of the outer insulation, and at least 3/4 of an inch of the inner wires. You'll be able to tell the right earbud from the left by the color of the wires, which will probably match that of the Apple wires.
Step 2: Decapitate Your Apple Earphones
The easiest way to do this is to grab the speaker body with some pliers and twist. Congratulations, you have officially voided your warranty. Untie the knot, and use a soldering iron or other heat source to melt the solder on the back of the speaker. I used a torch style butane lighter.
Cut the outermost insulation back about half an inch, perhaps a bit more. The side with the volume control has some extra wires in it, but they weren't connected to the speaker, and you don't need them for this operation, so just cut them back.
Step 3: Cut Heatshrink Tubing
For each earpiece, you'll need two short pieces of 1/16" tubing and one longer piece of 1/8" tubing.
Step 4: Remove Speaker Cone From Apple Earphones, Slip on Heatshrink Tube
If you don't remove the cone now, you'll end up with something like the pic above, and you'll feel really stupid.
Slip the 1/8" heatshrink tubing on to the Apple earphone wires before you do the splices, or you'll have to undo and redo them.
Step 5: Splice the Wires
If the earbud heads you're using are marked "R" and "L", splice the right earbud onto the wire with the volume controller. The colors will match for most earphones, but if not, you can figure it out with trial error. Twist them together, then hit them with a little heat to melt the insulation together. It's helpful to have them plugged into an audio source at this point so you can tell when the splices are working.
Make sure that one of the splices is no longer than the remaining outer insulation between the splice and the earbud, as you'll be laying one of the splices along that wire. (see photos on step 6 for reference)
Step 6: Seal the Splices With Heatshrink Tubing
The next step is to cover each splice with the narrow heatshrink tubing, then use a lighter or other heat source to shrink the tubing.
Split the splices so that one goes up toward the earbud, and the other goes down toward the jack. Now slip the 1/8" heatshrink tubing over both splices, use a lighter to shrink it down, and you're done.
Repeat for the other side, and you now have iPhone 3GS compatible in-ear earbuds.
Step 7: Rock Out
You're done. Go listen to some tunes.