Preheat the oven to 350 degrees F.
Put the fennel and onions in a roasting pan. Add the olive oil, salt, and pepper and toss to coat evenly. Roast until soft and lightly browned, about 1 hour, tossing once or twice. Let cool.
Combine the fennel mixture with the beans and toss to mix. Serve at room temperature.