1)He invited me to go to the disco with him that evening.
2) This prescription must be shown to the doctor.
3) "Fire now," the captain said to his soldiers. Indirect speech: The captain ordered his soldiers to fire then/at that moment (are both possible). Yes, both are fine.
4) "We had already finished the exercise when you arrived," they said.
Indirect speech: They said that they had already finished the exercise when I arrived.
5) The view<~~whose view? of man changed from the medieval period. Man was now placed between God and inanimate objects.
6) His function was to link all creatures. Also the view<~~whose view? of nature changed. It became an instrument that God used to rule over the universe, which was conceived in the forms of a chain of being and a cosmic dance.
In #s 3 and 4, when you have a complete sentence or question in a direct quotation, then the quotation marks need to be AFTER the end punctuation.