The octopus mainly eats crabs and other shelled invertebrates, though they do eat fish and small sharks as well. The fact that they eat crabs primarily is the reason why an octopus has a beak.
The octopus has a short crush beak for breaking through the thick shells of invertebrates such as crabs. In particular, the octopus eats mollusks, clams, lobsters and any fish they can grab. Usually this means small fish but on rare occasions an octopus that is large enough might try and eat a small shark if they can grab it with their tentacles. A baby octopus usually eats smaller invertebrates such as shrimp. Some types of octopus, such as the giant Pacific octopus might even go after birds that wander too close to the surface of the ocean or those that float on top or dive down going after fish. In addition to their tough beaks, the octopus has something called a salivary papilla that’s full of teeth that can bore through crustacean shells. Their saliva is also corrosive and can break down shells and even detach the soft undersides of crustaceans from their shells. The octopus then uses their barbed tongue to scoop out the animal.