The masseter primarily elevates the mandible. Some of the muscle fibres travel downwards and backwards, whereas other fibres travel straight downwards. This provides a lot of force through every angle as the mandible pivots.
Deep: Posterior third of the lower border and from the whole medial surface of the zygomatic arch (it is these fibres that pass straight downwards).
Superficial: Angle and the lower half of the lateral surface of the ramus of the mandible.
Deep: Upper half of the ramus and the lateral surface of the coronoid process of the mandible.
The V3 (mandibular) branch of the trigeminal nerve (cranial nerve V) innervates the temporalis muscle.
image courtesy of Flickr under creative commons license: https://www.flickr.com/photos/rswatski/4850030581/sizes/m/in/photostream/