It is difficult to judge its behavior when it is in a cup like that. However, the skinniness seen at the back of its head (the nape) shows that the fish has starved to the point of being too weak to swim properly. Has the fish been eating well for you? Have you been feeding enough food? When fish get this thin, there isn't really anything that you can do for them, as they have metabolized their liver for energy.
If you don't think it is starvation, take a look at this thread and answer the questions about your fish and the tank and we'll see if anything else comes up:
Aquarium Fish Disease Problem Solving Determining the best course of action for a problem with your aquarium can be a difficult task. Even advanced aquarists will often need to seek the help of others for complicated or unique issues. Our intent here on Reef 2 Reef is to offer expert advice...