It was the real Fury at the end of Avengers: Endgame at Tony's funeral. The director, Jon Watts, told this to Slash Film:
How long has Talos been impersonating Fury before this film begins, and can you talk me through the decision to have a Skrull play Fury in your movie?
In my mind, Talos has only been Fury from the beginning of this movie. That was real Nick Fury at Tony’s funeral…unless someone else tells me otherwise. I don’t want to get in too deep with that stuff. After I saw Captain Marvel, and really seeing so much more of Nick Fury’s origin story, it only made sense for us in this sort of con man story that we’re telling, to keep that on the table as just one last opportunity for a big reversal that makes you watch the whole movie in a different way.
Slash Film, ‘Spider-Man: Far From Home’ Spoilers: Director Jon Watts on the Post-Credits Scene, the Song He Wrote for the Film, and More [Interview]
It appears that sometime after the funeral Fury went up into space for a "holiday" and Talos, and his wife, impersonated him to cover for him. The timeline on how long after the Blip is unclear.
It is also unclear how many times, if at all, Talos and Fury have switched places in the past.
This could explain how Fury was able to eat diagonally cut toast in Avengers: Age of Ultron as explained in Captain Marvel apparently he couldn't. However, that might be reading too much into the film but it is up to you to decide if that was a filming mistake or Talos as Fury.