Final answer:
The muscle that extends the thigh and flexes the leg, and has two heads, is the biceps femoris.
Step-by-step explanation:
The muscle that extends the thigh and flexes the leg, and has two heads, is the biceps femoris. The biceps femoris is part of the hamstring group, which includes the biceps femoris, semitendinosus, and semimembranosus muscles. These muscles are located on the back of the leg and are responsible for flexing the knee.