user30318: Game.
First five moves:
[FEN ""]

1. e4 e6 2. d4 d5 3. e5 c5 4. c3 Nc6 5. f4

Why did white play f4?
My guesses:

To defend e5 in case if d4 falls.
Pawn pointing theory seems to indicate that white wants to launch kingside attack because black more often castles kingside.
To control more squares in center.

But doesn't f4 weaken white king?

user8300: As suggested, I'll convert my comment to an answer. Given this format however, I reckon a list makes more sense. So let's see how the move 5.f4 changes the position:

5.f4 is a slow move that wastes time for white in a line where White already invested a tempo on 3.e5.
5.f4 makes it easier for Black to develop their knight on g8 via h6, from where it lands on a great square on f5.
5.f4 weakens the diagonal g1-a7, making it more difficult for White's king to find safety.

So, to answer your question: White played 5.f4 in the game you linked because White wasn't a very strong player, not because 5.f4 was a good move. While it doesn't lose the game for White, it makes Black's game far easier, and White will be the one who has to solve some serious opening problems if Black knows how to turn the screws.
The best move in the position is the main line, 5.Nf3. This move defends d4 and develops White's knight. It also lets White retain control of the e3 square, which means that White's dark-squared bishop has a safe square on e3 to develop to.

30318: <p><a href="https://www.chess.com/game/live/30954615611" rel="nofollow noreferrer">Game</a>.</p>
<p>First five moves:</p>
<pre><code>[FEN &quot;&quot;]

1. e4 e6 2. d4 d5 3. e5 c5 4. c3 Nc6 5. f4
</code></pre>
<p>Why did white play f4?</p>
<p>My guesses:</p>
<ul>
<li>To defend e5 in case if d4 falls.</li>
<li>Pawn pointing theory seems to indicate that white wants to launch kingside attack because black more often castles kingside.</li>
<li>To control more squares in center.</li>
</ul>
<p>But doesn't f4 weaken white king?</p>
 8300: <p>As suggested, I'll convert my comment to an answer. Given this format however, I reckon a list makes more sense. So let's see how the move 5.f4 changes the position:</p>
<ul>
<li>5.f4 is a slow move that wastes time for white in a line where White already invested a tempo on 3.e5.</li>
<li>5.f4 makes it easier for Black to develop their knight on g8 via h6, from where it lands on a great square on f5.</li>
<li>5.f4 weakens the diagonal g1-a7, making it more difficult for White's king to find safety.</li>
</ul>
<p>So, to answer your question: White played 5.f4 in the game you linked because White wasn't a very strong player, not because 5.f4 was a good move. While it doesn't lose the game for White, it makes Black's game far easier, and White will be the one who has to solve some serious opening problems if Black knows how to turn the screws.</p>
<p>The best move in the position is the main line, 5.Nf3. This move defends d4 and develops White's knight. It also lets White retain control of the e3 square, which means that White's dark-squared bishop has a safe square on e3 to develop to.</p>
