There are several ways to classify organisms. One is by identifying “diagnostic traits”. Diagnostic traits are traits that are present in every single species of a given group, and only in that group. read more
We could make a definition like this: mammals are all animals descended from the last common ancestor of marsupials, placentals and monotremes. Since porcupines are descended from this common ancestor, we can consider them mammals. read more
A mammal is a warmblooded vertebrate animal of a class that is distinguished by the possession of hair or fur, the secretion of milk by females for the nourishment of the young, and (typically) the birth of live young. This applies to porcupines, so they are mammals. read more
In spite of this prickly suit of armor, there are some animals that prey on porcupines. The fisher is the most formidable predator, but great horned owls, coyotes, bobcats, mountain lions, and wolves will make a meal out of the porcupine if there's an opportunity. read more