In most instances, car trunks that fail to close have a malfunctioning latch. One way to know for sure if this is the case with a particular vehicle is to push the trunk down as if closing it. If the trunk doesn't stay closed, the problem is with the latch.
Fixing a broken trunk latch is usually fairly easy. Begin by locating the latch on the rim of the trunk. The clasp may be stuck in the closed or open position. Slide the barrel of a screwdriver into the latch and carefully work it loose. Add oil or lubricant to prevent the latch from getting stuck again.