Preheat oven to 400 °F
Oil a casserole dish
Layer 1/2 of the potatoes into bottom of the prepared casserole dish
Top with the onion slices, and add the remaining potatoes
Season with salt and pepper to taste.
In a medium-size saucepan, mix together the flour, salt and milk
Cook until mixture has thickened
Stir in cheese all at once, and continue stirring until melted, about 30 to 60 seconds
Pour cheese over the potatoes
Bake 50 minutes in the preheated oven