This actually a number of questions that conform to the title question, and which all stem from a bit of rules confusion.
Let's start with the rules confusion.
On pg 178, under the skill Investigation the rules says the following;
You might deduce the location of a hidden object,...
On the same page, directly to the right of the investigation skill, is a green box titled Finding a hidden object. In the box the rules says the following;
When your character searches for an hidden object such as a secret door or trap, the DM typically ask you to make a Wisdom (Perception) check.
Now here we have two skills that clearly does the same thing.
So my first question is: Are the skills interchangeable or mutually exclusive?
That is: can you use either skill to search for traps in any situation, or do you use Investigation only in specific situations you can't use Perception in, and Perception only in specific situations you can't use Investigation in?
My second question is: What do you use to make passive checks to spot a trap?
Do you only use Perception, as you would if a character did not have proficiency in either skill? Or, if a character is proficient in Investigation but not Perception, would you then use Investigation instead?
Which leads me to my last question: What if a character is alert to the possibility of hidden objects like traps, but isn't actively searching for them?
In other words, what happens if a player utters the oh so familiar words: "I'm prepared for the possibility that there might be traps in here." He/she isn't actively searching, but it isn't exactly passive either. If the character has proficiency in Investigation, do you then use that skill, or do you stay with Perception checks?
In other words: when do you use what skill?