A fish swimming vertically, nose-down, can mean one of two things. A few species of fish do this as part of their normal behavior. However, more often than not, a fish swimming at odd angles indicates issues with the swim bladder. Swim bladder problems have a host of causes. You need to identify the cause before you can fix it, assuming the behavior is not normal for your species.
A few species of fish swim this way normally. For example, the headstanders, a member of the tetra family, spend so much time vertical that their common name reflects it. Headstanders swim this way to find food on the ground. In the saltwater side of the aquarium hobby, shrimp fish, relatives of the seahorse, swim vertically to camouflage themselves. Lion fish, one of the jewels of the marine hobby, can actually manipulate the orientation of their swim bladders, letting them hang motionless at odd angles. This behavior can look bizarre if you're not used to it and has can be mistaken for illness if you haven't seen it before.
Swim Bladder Disease
The majority of fish use an organ called the swim bladder to control their density. This allows them to move up and down in the water column without using their fins. However, this organ amounts to a gas-filled sack that can be damaged a number of ways, including disease, injury and shock. Damage to the swim bladder can manifest with the fish swimming at odd angles, including head-down. Since this condition has a number of causes, it has different solutions depending on what caused it.
Swim Bladder Damage Causes
Several common problems can cause swim bladder disease. Selective breeding has produced some goldfish and designer cichlids with abnormally rounded bodies, which seems to contribute to swim bladder issues. Physical injury from fights or transport can cause swim bladder damage. Shock can cause issues with the swim bladder, as well, such as when introducing fish to a new aquarium improperly. Disease and constipation are other common causes of swim bladder disease.
First, you will need to identify the cause. If the affected fish has just been introduced to the aquarium, it is probably shock or physical damage from transport. In this case, your best bet is to let the fish work it out. This kind of damage typically heals on its own. If your fish starts swimming at odd angles after eating, though, it's probably constipation. Try skipping food one day per week and feeding brine shrimp, daphnia or elodea. If you cannot find another cause, it may be disease. Try aquarium antibiotics under the guidance of a vet who specializes in fish. In most cases, fish who don't have some kind of birth defect heal on their own without further treatment.