The Detective Mustache is classified as a common pet accessory in Adopt Me! that came out with the Scoob Event on May 4, 2020. It is currently in the 'Pet Wear' category and is worn on a pet's face. It was given to the player if they aged Scoob completely, along with the Detective Hat and Magnifying Glass.
Since the Scoob Event ended, this accessory can now only be obtained by trading.