Heat the butter in a saucepan over medium heat until melted and beginning to bubble.
Add the flour and whisk together until it forms a consistent paste (the roux). Keep stirring the roux for 1-2 minutes to cook. It should begin to smell nutty.
Pour the milk over the roux and whisk vigorously and consistently. The milk can be poured in either all at once or ⅓ at a time - both ways are fine.Keep whisking until the bechamel thickens (3-4 minutes). If lumpy, whisk more vigorously. See post for troubleshooting details.
Stir in the gruyere and salt. Taste the béchamel and add more salt as needed, keeping in mind it will also need to be seasoned enough for the fennel too.
assemble the gratin
Lay the fennel out in your roasting pan.
Pour the béchamel over the squash fennel. You can also add a bit of cheese on top to make a cheesy crust (this is optional).
Reduce the oven temperature to 180 C / 360 F before putting the gratin in.
Bake for at least 30 minutes or until the top is golden. If it browns too much in some spots, reduce the heat and roast until an even golden brown.