The title refers to the number of movies Federico Fellini had directed up until that point - six features, two shorts (films #7 and #8) and a co-directed film with Alberto Lattuada, for a total of 8 1/2 films.
Federico Fellini was well-known for working without a stable, finished screenplay. At one point during pre-production, he had completely forgot what his next work would have been about, his original idea had completely gone. While he was set to communicate to the movie producer Angelo Rizzoli his intention of abandoning the project, Fellini was invited to the birthday party of a head camera-operator of Cinecittà. All of a sudden, during the celebration, he got a new idea: his film would have told about a film-director who was going to direct a film, but he forgot what it was about.
8½ was shot, like almost all Italian movies at the time, completely without sound recording on set. All dialogue was dubbed during post production. Fellini was known for shouting direction at his actors during shooting, and for rewriting dialogue afterwards, making a lot of the dialogue in the movie appear out-of-sync. (Source: High-def Digest)
The original ending scene featured Guido and his wife sitting together in the restaurant car of a train bound for Rome. Lost in thought, Guido looked up to see all the characters of his film smiling ambiguously at him as the train entered a tunnel. Federico Fellini then shot an alternative ending set around the spaceship on the beach at dusk but with the intention of using the scenes as a trailer for promotional purposes only. He and his co-writers, however, decided that this alternate sequence served as a more harmonious and exuberant ending to the film.
Because of a strike at the development & print lab at Cinecittà, during post-production, Federico Fellini was unable to check the daily shoot. He reportedly never took vision of the filmed material until the movie editing phase.