Preheat the oven to 400°. Spread the onions in a baking dish. Drizzle with the oil and season with salt and pepper. Roast the onions on the top shelf of the oven for about 50 minutes, or until they are tender and caramelized; turn the onions halfway through roasting. Serve hot or at room temperature.