This question already has an answer here:
In 1988 I read a short story about a man who was on his way to work. He meets a friend at the bus stop and they engage in small talk, then get on the bus and go to work. They come home and go to sleep. The next morning, the guy goes out to the bus stop and meets his friend, and is surprised to hear his friend saying the exact same things he said the day before.
All day at work things happen exactly as they did the day before. The next morning is a repeat of the same, and he begins trying to get his friend to see that they are living in some kind of time loop, but his friend doesn't know what he's talking about.
The guy ends up staying home the next day, hiding in his house. Finally someone comes to his door and tells him he has been part of an experiment. Every night when they go to sleep their minds are erased. Scientists are observing behavior to see if in a given scenario there is any deviation in word or action if a person is subjected to the same stimuli repeatedly, if they have no knowledge of ever having done it before. For some reason, they forgot to erase his memory and he began remembering the previous days.
He doesn't believe what he is being told until he looks out the window and sees a giant in a lab coat. Turns out his house is just a small model on a train-type layout sitting on a table and he is one of many miniature "people" the scientists made to test their theories.
No idea who the author is or what the title was. I took a science fiction class in high school and this was one of the stories we had to read and then answer questions about.