I was pretty confident that animal companions could use all their primary attacks until I thought about it in the context of the Multiattack feat. Can an animal companion do so before obtaining this feat? If so could you point me to the RAW?
Yes, Animal Companions get all attacks listed in their stat block (primary and secondary) starting at the level that lists them.
The animal companion's Multiattack ability (granted at 9th level) states,
An animal companion gains Multiattack as a bonus feat if it has three or more natural attacks and does not already have that feat. If it does not have the requisite three or more natural attacks, the animal companion instead gains a second attack with its primary natural weapon, albeit at a –5 penalty.
The Multiattack feat itself says,
Benefit: The creature's secondary attacks with natural weapons take only a –2 penalty.
Normal: Without this feat, the creature's secondary attacks with natural weapons take a –5 penalty.
In other words:
- Animals can attack with whatever attacks are listed in their stat block.
- If those attacks include secondary attacks (e.g. hooves) those secondary attacks are at -5.
- Once that creature reaches 9th level, the Multiattack feat reduces that penalty to -2.
Note that some animals have 3+ primary attacks and no secondary attacks (e.g. the Big Cat). Because all three are primary, they get no penalty to hit on any of their three attacks, even at 1st level. At 9th level they'll gain the Multiattack feat...but it won't actually help them. While this may seem a bit odd it's clearly the way the rules work...and I wouldn't shed a tear over it because animals with 3+ primary attacks are probably already great companions.
Since you asked "could you point me to the RAW", see Monster Entry Format in the Rules for Monsters section, which says,
Melee The creature's melee attacks are listed here, with its attack roll modifier listed after the attack's name followed by the damage and crit modifiers in parentheses. See example for details.
I think that's the closet the rules get to saying "Creatures get access to anything listed in their stat blocks (including any attacks)".
EDIT: As KRyan noted in a comment, people often forget that creatures only get all the attacks as a Full-Attack. On a standard-action Attack, they only get one attack. (This is true for Animal Companions...and any other creature with multiple attacks, unless its rules text explicitly allows it to do more on a standard-attack.)
EDIT 2: User highbandwidth asks in a comment how one knows what are Primary vs Secondary attacks. The general rules are in this table (so cats, badgers, and anthing else with claw/claw/bite have only primary attacks).