Do you mean like this?
http://www.pbase.com/s_parrott/image/142947194
You use any editing program that supports layers. Gimp is such a program, as is Photoshop, however Gimp is free.
You mount the camera on a tripod and do not allow it to change position or exposure settings. You then take a photo of yourself, using the self timer on the camera or a remote shutter release. You then take another photo of yourself in a different location. You can do this several times if you want, as was done in my example.
You then open the photos in the editing program. You stack one photo onto another, creating a layer. You erase away all parts of the photo except for the subject. This will also reveal the background photo with the subject in a different location. If you have more photos, you stack another onto the layer stack. Again, you use the eraser tool to erase away all of the photo on the top of the layer stack except for the subject. You will then reveal the layers underneath with the subjects in different locations.
It is easier to do than explain, though you may have trouble with it if you have no experience or skill in using layers in a photo editing program.
steve
PS.... that idiotic "app" mentioned in the other answer is NOT the same thing.