"In North and South America" is a prepositional phrase; therefore, "in" is a preposition.
Prepositions are words which are generally used before nouns, determiners or pronouns. They usually indicate the position and direction of something, as in the example, or the time when something happens. Some of the most common prepositions are in, on, from, up and between. Furthermore, prepositions are function words, which means they have little meaning when they are standing on their own, and they also form a closed class because, unlike nouns and adjectives, the number of prepositions is limited.