The origin of fiction is not something that can be precisely dated. It developed throughout history as people's creativity and desire to tell made-up tales grew. Different cultures likely had early forms of fiction at various points.
The invention of novels is a gradual process that can't be tied to a specific moment. They developed from earlier forms of storytelling throughout history.
Fan fiction has been around for quite some time, but it's hard to pinpoint an exact date. It likely emerged in the late 20th century as a way for fans to expand on their favorite stories.