"In the museum, you can learn which animals were living in prehistoric times."
Translation:In het museum kan je leren welke dieren er in de prehistorie leefden.
"Wonen" is a verb meaning living in a specific location, usually involving a structure (house, building, tent, etc.) or a village/town/city/country, etc. "Leven" is the verb meaning "to live." Even if the above sentence had said "In the museum, you can learn which animals were living in the tropical forest in prehistoric times", you would still use "leefden" in Dutch.
It's used together with the indefinite subject ("welke dieren") of the subordinate clause. You can safely omit "er" here, although it sounds more natural to include it. It doesn't really carry a meaning.