As long as the firm produces something, it will maximize its profits by producing "on the marginal cost curve." But it might produce nothing at all. When will the firm shut down?
The answer goes a bit against common sense. The firm will shut down if it cannot cover its variable costs. So long as it can cover the variable costs, it will continue to produce.
This is an application of the opportunity cost principle. Just because fixed costs are fixed, they are not opportunity costs in the short run -- so they are not relevant to the decision to shut down. Even if the company shuts down, it must pay the fixed costs anyway. But the variable costs are avoidable -- they are opportunity costs! So the firm will shut down it it cannot meet the variable (short run opportunity) costs. But as long as it can pay the variable costs and still have something to apply toward the fixed costs, it is better off continuing to produce.
It is important not to confuse shut-down with bankruptcy. They are two different things. If a company cannot pay its interest and debt payments (usually fixed costs), then it is bankrupt. But that doesn't mean it will shut down. Bankrupt firms are often reorganized under new ownership, and continue to produce -- just because they can cover their variable costs, and so the new owners do better to continue producing than to shut down.