Preheat the oven to 375°F, and generously grease a small heart-shaped cake pan or a large baking sheet.
Grate the beet and potato in a food processor. (You can grate them by hand, but it will be messy.)
Place the grated beets, potato, and onion in a bowl. Sprinkle with the flour, salt, and pepper, and toss well to coat.
If using the heart-shaped pan, spread the beet and potato mixture in the pan and press with a spatula to compress evenly.
If you don’t have a heart-shaped pan, transfer the mixture onto the prepared baking sheet and press it together into the shape of a heart. (You can divide the mixture in half and shape it into two smaller hearts, if you prefer.)
Drizzle with the olive oil, cover tightly with foil, and bake for 20 minutes.
Carefully remove the rosti from the over and place a plate on top, invert, and slide the rosti (even if baked in the pan) onto the baking sheet. If you’ve made small hearts, flip them over carefully with a metal spatula.
Return to the oven to brown the other side, about 20 minutes.