Preheat oven to 400°. Rub the inside of an 8" × 8" baking dish with 1 tbsp. of the butter. Smash garlic with the side of a knife and sprinkle generously with salt. Chop and scrape the garlic into a mushy paste.
Combine garlic paste, potatoes, half-and-half, and remaining 4 tbsp. butter (cut into ½" pieces) in a pot; stir. Season with salt and pepper and taste the creamy liquid—it should be seasoned generously. Grate in a hint of nutmeg. Bring to a boil over medium-high heat while stirring the mixture with a wooden spoon. After 8–10 minutes the potatoes will be a little tender, and their starch will have thickened the liquid considerably.
Transfer the mixture to the prepared dish; smooth the top as much as possible. Cover the gratin with gruyère and bake until deeply golden brown, about 20–30 minutes. Let gratin cool and set a little before serving.