Answer
An octopus changes its skin color and coordinates its body movement resembling fish at the cost of its energy, this behavior of the octopus helps it to survive in the ocean against predation by carnivorous animals. Though this behavior requires them to spend energy, it also protects them and makes them fit.
Work Step by Step
The color-changing mimicry of the octopus that is an invertebrate and falls in the Mollusca class will help it to avoid predation. By changing its body posture like a fish, it may be able to survive the harsh conditions and pass on the adaptive genes to its next generation.
This behavior demands the expenditure of an ample amount of energy. This is an adaptive behavior that protects it from predation. In case an octopus is successful enough to survive after mimicking this fish-like trait, the alleles would pass on to its next generation.