The Rules
The rules don't address this in much detail. Strictly speaking, the animal is an independent, intelligent creature and should have its own initiative. That means it's going to act on its own in the absence of a Handle Animal command. The DM gets to determine what that means.
As you noted, this is no problem if you get to go before the animal does. If the animal goes first, it can be annoying.
Why That Sucks
Most games I've played in (including the one I'm DMing right now) don't handle it that way. I find that players find the extra initiatives confusing, get unhappy when the DM has the animal do something before the player can react, and so on. You've got what is essentially a powerful class feature that you can command, except in this edge case at the start of combat where sometimes you can command it and sometimes you can't.
The people I play with love consistency, and that edge case is inconsistent.
Solving It
We solved that annoyance in two ways:
- Tell the DM a "default" command that you're giving the companion while you're not in combat. As it's a free action you can just keep doing it while you're wandering around town/the dungeon/whatever and have it continuously in effect. Normal ones are Heel (The animal follows you closely, even to places where it normally wouldn’t go) and Defend (The animal defends you (or is ready to defend you if no threat is present), even without any command being given). Which one depends on if you want the animal to attack something automatically if you get attacked, or to just follow and wait for your command. This removes the inconsistency, as at least the DM now knows that 6 seconds ago you told the animal to Heel in the last round, and it should probably keep doing that until you get a chance to react.
- House Rule - Animal Companions always start on the same initiative as their PC. Not strictly necessary, but as it makes things simple and consistent, the people I play with like it.
I'd use custom items to accomplish this. First is an item to allow your aquatic animal to walk:
Belt of Piscine Endowment
Aura faint transmutation; CL 5th
Slot belt; Price 30,000 gp; Weight 1 lb.
DESCRIPTION
When above water, this belt seems to be made of sharkskin. When below water, it seems to be made of the skin of a furry mammal.
When worn, this item allows aquatic creatures to grow legs and gain a land speed, exactly as the spell fins to feet.
CONSTRUCTION REQUIREMENTS
Craft Wondrous Item, fins to feet; Cost 15,000 gp.
Since all aquatic creatures either have a belt slot or a land speed (at least, all the ones I know of do), this works on all non-walking aquatic creatures. Before you can afford this item, you can use the Fins to Feet spell, which is a level 3 wizard, witch, and druid spell.
For the ability to breathe, there are a few options, depending on how much you want to stick to RAW.
First is a custom magic item of sea steed (18,000 GP). This is intended to allow land-based animal companions to work as sea-based animal companions, but it works just fine either way. This gives the animal the amphibious quality, allowing it to breathe on land as well as under water. This spell doesn't last long enough to make it practical as something to cast regularly before you gain access to the item.
Second is the Waterskin of Woe (80000 gp). This item lets you remove all the water from a creature, and "does not need to breathe, eat, drink or sleep and is immune to non-lethal damage." Since it doesn't specify what you no longer need to breathe, it should work on your shark just fine. The problem with it is that it deals 1 point on Constitution damage per day that it was used once you stop using it, and can only be used for a number of days equal to your Con score. However, there is no limit to the number of times you can use it per day, so you could easily turn it off at night, heal any Con damage with lesser restoration, and turn it back on while the aquatic creature holds its breath.
Third is the Necklace of Adaptation (9000 gp). There are a few problems with this as written. For one, it is a neck slot item, and the magic item slots for animals guidelines say that neither sharks nor octopi have neck slots. However, you might be able to make the argument that you could put it on a belt slot instead, possibly for a higher cost. Next, it specifically talks about creating a "shell of fresh air" around the user, which doesn't really help aquatic creatures. Again, I think the argument could be reasonably made to allow a shell of fresh (or salt, I guess) water to be used instead, if the item is made for aquatic creatures.
Fourth is a custom magic item of life bubble (56,000 gp). This effectively works like water wreathing, but it doesn't specify that it lets a creature breathe air, only that it lets a creature breathe comfortably. It actually creates a 1 inch shell of "tolerable living conditions", which could be fresh or salt water as easily as air. For a shark, it's probably moving water, which will likely be a tad inconvenient.
Since fins to feet is 3rd level, and life bubble is 4th level, you can have a land-based shark or octopus by 7th level for the cost of 4 spells per day. 2 castings of fins to feet will get you through an adventuring day, and 2 castings of life bubble will get you through the 24 hours that you need to keep your animal breathing. Since most aquatic creature have limited equipment slots, you will likely need to put two of these effects on the same item, likely a belt. This will cost the same as the added cost of the two effects, plus half the cost of the cheaper ability (or the new ability, if created in play).
IF you want to go the super-expensive route, you could also gate in a Personification of Fury every morning, since it has a special air breathing spell-like ability, which works like water breathing, but lets aquatic creatures breathe air.
Best Answer
Be careful not to confuse the two entities shamans work with: one is a spirit, the other is a living animal representing that spirit in the physical world.
First, no, the spirit animal is not an animal companion. It is a living creature that mostly works like a wizard's familiar:
So it can only fight for you as much as a familiar normally can, using its natural abilities. It doesn't advance like a druid's animal companion, and if it's killed you're hooped for spellcasting for at least a little bit.
Yes, you need to have your spirit animal with you to prepare spells, as it is the conduit to the source of the shaman's spells:
So, a concrete example might help. If you have a bond with the Spirit of Otters, you would commune with that spirit via a living otter, which is called your spirit animal. If the otter is slain, a new otter would have to be found to serve as a conduit to the Spirit of Otters. The otter can fight for you, but that's risky and otters are not great fighters, nor will the otter ever become a great fighter.