Typically moving your f pawn isn't advisable in the opening, but black has to relieve the pressure on f7 in this particular scenario in order to survive. If black simply tries to kick the knight with 6. h6, white will sacrifice on f7 with Nxf7, and after kxf7, qf3+ with a fork on the knight on d5 and the king on f7. 6. f6 in this particular scenario relieves the pressure on f7 and kicks the knight, and after the knight retreats to f3, black can play nb6 and avoid any trouble
For future reference, this is how you should play against 4. ng5
in this game
https://www.chess.com/analysis/game/live/24628916723?tab=analysis
the computer says that move 6 I should have moved my f pawn. But isn't moving the f pawn a big no no? I guess 'cos it opens a diagonal attack on the king.. and does it mess up pawns in any kingside castling?
I can't see how that scenario plays out according to the computer e.g. is king-side castling then a no no?
And castling aside.. It opens up a diagonal attack.. so i'd have thought that if moving the f pawn was a good idea, then it'd suggest I messed up before it. But all my moves it says were book moves before that.