Here's a finite version of the problem, cast as a game.
Perhaps the game is well known, I'm not sure, however the resolution of the game is nice, and not immediately obvious, so I'll pose it here as a challenge.
2-player play a game, win or lose, for 1 dollar, based on a fixed positive integer n > 1, known in advance to both players.
Player 1 chooses two distinct integers from 1 to n inclusive, writes them on separate index cards, and places them face down on the table.
Player 2 then selects one of the cards and turns it face up, exposing the hidden value. Player 2 can then either "stay", yielding the value on the chosen card, or "switch", yielding the value on the other card instead. Player 2 wins (and player 1 loses) if player 2's final value is the higher of the 2 values, otherwise player 2 loses (and player 1 wins).
In terms of n, find the value of the game for player 2, and specify optimal strategies for both players.