Dates back to the Lumière brothers and the first films made for publich viewing in 1895—specifically, The Photographical Congress Arrives in Lyon, in which several of the photographers wave or doff their hats to the camera.
In the 1914 film "The Knockout", Fatty Arbuckle is going to change clothes but stops, looks at the audience, then motions to the cameraman to raise the focus of the camera while he changes.
Charlie Chaplin's very first appearance as the Tramp, in the 1914 short "Kid Auto Races at Venice," features this as the Running Gag. Most of the short is supposedly news footage of the race, but the Tramp wants to appear on film and keeps wandering into the shot. The director continually yells at him to move out of the way (as suggested by the Tramp's reactions and gestures off-camera) and comes out from behind the camera to shove him aside. The point of view occasionally shifts to a third party perspective so that the viewer can see the camera and the director standing beside it.
Maurice Chevalier frequently addresses songs to the audience in his early musical films:
"Nobody's Using It Now" in The Love Parade (1929).
In One Hour with You (1932), both Chevalier and his co-star Jeanette MacDonald frequently talk and sing to the audience.
Korean film The Housemaid, a dark story about obsession and murder centering around a married man who has an affair with his maid, has a bizarre ending in which the husband addresses the audience directly, saying that men shouldn't chase younger women, wagging his finger, and laughing.
It's rare to find one of Amicus Productions' portmanteau horror films that doesn't end with a character breaking the fourth wall, frequently directly addressing the audience. Noteworthy examples: Asylum, Tales From the Crypt, The House That Dripped Blood, and From Beyond The Grave.
In Into the Wild there's a scene where the protagonist stares at the camera and gesticulates.
During the titular song of Guys and Dolls, while discussing guys doning things for their dolls, Nicely Nicely points at the camera and remarks at the men who are watching the movie for their signficant others.
In Airplane! after Elaine tells Ted she can't see him anymore, he turns to the camera and says, "What a pisser."
In the George of the Jungle movie, the Narrator says that the characters react with awe at a mountain, at which they all go "Awwwww". He repeats himself, spelling out the word and they say "Ooooh". Later, the bad guys get into an argument with the narrator after he refuses to help them.
Narrator: ...wait a minute! You're not George!
George: Me new George! Studio too cheap to get Brendan Fraser.
In The Wizard of Oz, when Dorothy is locked in the Witch's castle, she sees Auntie Em's image in the crystal ball, looking for her. Auntie Em's image is then replaced by the Wicked Witch's image, who mocks Dorothy and then turns to cackle directly at the audience, possibly to secretly taunt/scare the audience as well.
Billy Ray Valentine in Trading Places turns to look directly at the camera after being told that you might find bacon in a "bacon, lettuce and tomato sandwich". This is a recurring element in John Landis' films - it's also seen in Coming to America and Spies Like Us.
The 1941 classic Hellzapoppin' absolutely obliterates the fourth wall: the characters comment on other plots, they talk to the audience, they talk to the projectionist (and in fact, when the shot goes out of frame, they confront the projectionist, who it turned out was getting a little action in his booth), they deconstruct myths, they talk to still photographs (which come alive), they pause the phrase, mock the movie they're watching and the movie they're in (including muting the soundtrack and making jokes over it MST3K-style), criticize the writing, talk about their roles, use double-exposures deliberately, control the direction, and have a running joke with overlaid wording that "Stinky Miller" needs to go to the lobby because his mother is looking for him, and the characters stop in the middle of a musical number to yell at Stinky, who eventually (in silhouette), gets up and leaves. Whew.
Perhaps the earliest film example is The Great Train Robbery (1903), which ends with a shot of a gunslinger shooting at the camera, causing many in the audience to duck for cover, as they actually thought they were going to get shot.
Another early example is the 1963 film Tom Jones, starring Albert Finney. In one scene, he finds that all his money had been stolen while he slept, and he shouts at the chambermaid, demanding to know if it was her who robbed him. Unsatisfied with her answers, he turns to the camera and shouts "DID YOU SEE HER?! DID YOU?!"
At the end of Amélie, two characters are shown riding down the street on a motorcycle, teasing one another playfully and generally being so deeply in love that they are completely oblivious to the world around them. Then, for a second, they both turn and make faces at the camera.
Henry's direct-to-camera address in the courtroom scene near the end of Goodfellas - justified by, though still striking in spite of, his being the voice-over narrator throughout the film.
Blazing Saddles has a pretty flimsy fourth wall to begin with, but by the end of the movie it completely collapses.
During a speech, Hedley Lamaar says "You will only be risking your lives, while I will be risking an almost certain Academy Award nomination for Best Supporting Actor."
The big fight towards the end of the movie breaks out of the set and ruins a neighboring Busby Berkeley Number. This would be breaking the third wall.
Taggart: "Piss on you! I'm working for Mel Brooks!" (writer/director).
The end fight scene, where they break through the wall of the studio and continue the fight across several sets, culminating in Hedley Lamarr fleeing to Grauman's Chinese Theatre, and dying next to Douglas Fairbanks's footprints.
The final scene in the movie escalates directly to No Fourth Wall, in which the two main characters watch the end of their own movie together at the Chinese Theatre.
In a rare non-comedy example, there is a moment in Fight Club when Tyler Durden begins monologuing: "You are not the car you drive. You are not the contents of your wallet..." By the end of the monologue ("You are the all-singing, all-dancing crap of the world.") he is looking directly into the camera, and the film shakes and appears to come loose (the sprocket holes are visible). Also an allusion to his job as a projectionist, and habit of tampering with the films. As he does at the end of Fight Club.
Anything Else's protagonist repeatedly explains to the camera his predicaments and thoughts.
In the original film The Producers, Max sees some of Leo's eccentricities and says to the camera "This man should be in a straitjacket." In the musical adaptation and the later film based on it, Max says the line to a statue instead, though there is an outtake from the second film where Nathan Lane says it to the camera, then realizes it's supposed to be different in this film.
Also in the remake: in a jail cell, Max answers his own question of "How did I get into this mess?" by re-enacting the entire movie with snatches of dialogue and song. Brilliant.
Intermission! * Pulls out the program book, reads it* ... * Continues*
This is, to some extent, the plot of the movie Stranger Than Fiction, in which the main character discovers that he is a character in a book.
However, the main character never becomes aware of or interacts with the audience. Since he exists in the same reality as the writer who's guiding the events of his life, it's more a case of internal meta-fiction.
Happens a couple of times in Robin Hood: Men in Tights, with one example being when the view is zooming in on outside of Maid Marian's room, whereupon the shot switches to inside her room. A couple of minutes later, the camera (which had been doing the outside view) smashes through the window, before retreating rather awkwardly. The fourth wall is then again broken later, when the Abbot is walking up the aisle of Maid Marian and the Sherrif of Rottingham's wedding, and his staff hits the camera, causing the Abbot to loudly say "Sorry!".
Wouldn't the incident with the camera breaking the window technically be the Inverted Trope
The big archery tournament, where everyone pulls out a copy of the script to confirm that Robin gets another shot.
And during Robin and the Sheriff's fight scene, one of them accidentally skewers a set worker's bagel on their sword, who had been leaning through a 'window', showing the rest of the studio.
The very first scene in the movie when, as the village is being burned to the ground, one of the villagers says, "There must be a better way of doing the credits," to which another responds, "That's right! Every time they make a Robin Hood movie they burn our village down." They soon have all the villagers exclaim in one harrassed voice: "Leave us alone, Mel Brooks!"
And then there's the wonderful line at the end where Robin names Achoo Sheriff of Rottingham. Everyone yells "A black sheriff?!?!?!" Achoo looks right into the camera and says, "Why not? It worked in Blazing Saddles."
A cameraman bites it during the climactic battle sequence between Lone Starr and Dark Helmet. Earlier, Yogurt promises that the whole crew will meet again in Spaceballs II: The Search for More Money. (Promising sequels that never happened also occurred in Mel Brooks' History of the World Part I.)
The scene where they located the hero Lone Star by popping in a copy of Spaceballs on VHS, explaining that through the advancement of technology movies could now come out on VHS before they were even finished filming them. If only that poor camera guy knew about that.....
After having his own dastardly plan explained to him by his first officer, Dark Helmet turns to the camera and asks, "Everybody got that?" (Which has been shown to bleed into the animated series as well.)
The stunt doubles getting captured instead of our real heroes
Dark Helmet is knocked over by the camera as it moves in for a close-up.
All that Spaceballs merchandise in Yogurt's hut and all throughout the movie, including "Spaceballs the Toilet Paper" and "Spaceballs the Bedsheets". "Spaceballs the FLAMETHROWER! the kids love this one."
One of Ben Affleck's characters says to the eponymous duo, "A Jay and Silent Bob movie? Who'd pay to see that?" At which point all three of them turn and glare at the audience.
Another scene with Matt Damon and Ben Affleck, reprising their roles in Good Will Hunting for a sequel, are arguing about their motivations for accepting certain roles, with Affleck finishing with "...you gotta do the payback picture because your friend says you owe him." With a pause to look at the camera... just for good measure.
Most movies starring The Muppets involve some degree of fourth wall breaking. For instance, in The Muppet Movie, Kermit tells Fozzie not to explain the story so far to the other characters, for fear of boring the audience (Fozzie then gives the other characters a copy of the script to read). In The Great Muppet Caper, one scene suddenly stops as Kermit scolds Miss Piggy for over-acting.
The Muppet Christmas Carol featured Gonzo (as Dickens) and Rizzo narrating the movie. During the Ghost of Christmas Yet To Come sequence, they decide that the scene is too scary for them, with Gonzo telling the audience, "You're on your own. See you at the finale!"
When Scrooge lights the lamp to search his house, it turns out to be an electric light.
During the special memorial program for Jim Henson, one of the Muppets asks about including "those other people" in the memorial. "What other people?" is asked, and the first replies, "Them, down there", while gesturing toward the unseen puppeteers below the lower edge of the screen. After a few moments, he then adds, "On second thought, don't look. It's too weird" to general agreement.
In Smokey and the Bandit there is a scene early on where Bandit (Burt Reynolds) is being pursued by a city cop. He escapes by pulling his Firebird into a used car lot, then pulls away, slowly, as he checks to make sure the police car is gone. Just for a moment, he stops the car, then turns and looks directly at the camera. He flashes this most WONDERFUL "Ain't I Something?" grin, and then turns away and proceeds with the movie.
In Harry Potter and the Goblet of Fire Hermione, when Fred and George try to put their names into the Goblet, she addresses the audience. Though it could be argued that it is the usual "I know this so well that I'm not going to turn around to talk to you" thing that mothers do all the time and girls start at an early age. The camera is aimed at the perfect angle to make both interpretations work, so this might have been planned.
At the start of Mary Poppins, Burt greets the audience and leads them to the Banks home.
At the end of Mr. Blandings Builds His Dream House, the three main characters invite the audience to come and visit them some time.
The beginning of Designing Woman has the main characters spell out their roles in the film, and they narrate throughout the film when necessary.
At the beginning and ending of Whatever Works, Boris turns his friend's attentions to the audience watching them. Some people don't believe him, others wave.
In The Devil and Miss Jones, the film begins with a title card that goes like so: “Dear Richest Men in the World: We made up this character in this story, out of our own heads. It’s nobody, really. The whole thing is make-believe. We’d feel awful if anybody was offended. Thank you, The Author, Director, and Producer. P.S. Nobody Sue.” And then this appears: “P.P.S. PLEASE”.
Dr. Frank N. Furter of The Rocky Horror Picture Show seems to be aware of the audience, throwing a drink at the camera during Sweet Transvestite and meeting the audience's gaze at other times. He even addresses them directly at least once, when he says, "It's not easy having a good time! Even smiling makes my face ache!" None of the other characters seem to share his knowledge.
And the Criminologist, who appears to exist in a reality distinct both from the film itself and the viewers, and aware of both.
During the dinner scene, Dr. Scott turns to the camera and speaks directly to the audience.
An 'in-universe' example in Woody Allen's Purple Rose of Cairo. The lead character watches the eponymous movie so many times that the lead actor in the movie falls in love with her and breaks out through the cinema screen to join her. The rest of the characters in the movie have to wait around since the plot cannot continue without him.
In another Woody Allen movie, Annie Hall, a puffed up character: Man-In-Theatre-Line, spouts nonsense about Marshall McLuhan's theories of media. Allen's character Alvy argues with him, and then pulls the real Marshall McLuhan into the shot to back up his argument. Once that is done, Alvy faces the audience and says "Boy, if life were only like this!" He does this on many other occasions too.
At the end of Secretary, Maggie Gyllenhaal's character looks directly at the camera and practically smirks as her new husband drives away. Considering her behavior and decisions are, shall we say, unorthodox throughout the film, it comes off as a direct challenge.
Near the end of A Shot in the Dark, Clouseau gathers the suspects in the case together as part of a plot to catch the killer. It turns out that all the suspects have been having affairs with each other and, with one exception, have committed at least one murder, the admission of which leads to a massive row between all the suspects. Clouseau is unable to get a word in edgeways and ends up looking at the audience in exasperation.
In the extended cut of Monty Python and the Holy Grail, Dingo turns to the camera partway through her scene and starts talking to the audience about how she didn't think the scene was funny, but now that she's had the chance to perform it has changed her mind. This results in various other characters from the film appearing and telling her to shut up and GET ON WITH IT!
At another point, a monster died because the person animating it had a heart attack.
One of the best examples of completely obliterating the Fourth Wall is when he rewinds the effing movie to reverse the death of the other killer.
The eponymous character in Kuffs talks to the audience throughout the movie, sometimes in the presence of other characters who fail to notice.
In The Neverending Story, near the end, the Childlike Empress tells Atreyu that as he was adventuring through Fantasia, the Earth-child Bastian was sharing his adventures by reading the story, then mentions that others are sharing Bastian's adventure, referencing the viewers.
Twice in the 2003 live-action adaptation of Peter Pan, Smee addresses the audience, in both cases to remark on the story ("It's all a bit tragic, isn't it?" and "How exciting, two dead so far!") in progress.
In Zombie Strippers, a man is pulled into the champagne room by the zombified stripper played by Jenna Jameson. When the man says "Baby, I've been dying to get to a lap dance with you!", Jameson smiles and shoots the camera a look that positively shatters the fourth wall.
In Horse Feathers, Groucho's putting the moves on Thelma Todd is interrupted by Chico's barging in. He launches into one of his piano numbers; Groucho steps up to the screen and tells us "You know, I've gotta stay here, but there's no reason you shouldn't go out to the lobby 'til this whole thing blows over!"
Also, in The Big Store, Groucho parades some beautiful women. One of them is wearing a red dress and he tells the audience that 'This dress is really bright red, but Technicolor is sooo expensive'.
And in Go West, after the brothers hijack a train and tie up the engineer, after putting a sock in his mouth, Groucho turns to the camera and says "You know this is the best gag in the picture?"
In This Girl's Life, the main character, Moon, breaks the fourth wall throughout the film, but this becomes a little confusing because her character is a webcam star who also talks to the camera from time to time. At times, it's not immediately obvious whether she's talking to the real audience or the webcam audience.
In the Ian McKellen version of Richard III, Richard (McKellen) often turns to the audience to comment on the action, following Shakespeare's script.
In the old Dean Martin/Frank Sinatra comedy Western Four For Texas, Martin turns to the audience on several occasions and gives them wry/conspiratorial looks when something particularly odd happens.
Help! - Ringo is trapped in a cellar; he hoists up a ladder but several rungs snap under his weight - he turns to the camera and deadpans "All of the rungs have been neatly sawed in the middle!" Earlier on, Eleanor Bron as Ahme thwarts one of her bad guy superior's traps and tells us "I am not what I seem."
Hot Tub Time Machine has the scene where the characters realize that the hot tub has taken them back in time. When this dawns upon Nick, he says, "It must be some sort of... hot tub time machine," and then turns to stare at the audience.
Austin Powers in Goldmember. During a meeting with Mr. Robotto of Robotto industries, subtitles appear at the bottom of the screen, until it appears that Robotto has said “Please eat some shit.” to which Austin reacts to in shock, until Foxy moves a tray along the table which was the same colour as the subtitles, revealing it to read “Please eat some shitake mushrooms.” the joke is repeated a few more times, until Robotto says “Maybe I should just speak in English?” to which Austin comments “Now that would be a good idea wouldn't it, then I wouldn't be misread the subtitles and thinking you're saying dirty things.”
In Bedtime Stories the narrator breaks the fourth wall near the end of the movie, asking the main character if this is really how he's gonna have the story end.
Frank in Maniac addresses the viewer during one of his insane ramblings.
In the Wayne's World movies, Wayne frequently addresses the audience to provide exposition or commentary on the action. At one point in the first film, he goes on a lengthy tirade about his problems, to the point where the camera tries to get away from him and has to be coaxed back.
In the first film, the server at the donut shop (Played by an extra-insane Ed O'Neill) starts a monologue/flashback, talking to the camera. Wayne interrupts and reminds him that only Wayne and Garth are allowed to address the audience.
In Some Like It Hot, Joe manages to hatch a plan to escape from the gangsters. As he arranges everything by phone, Jerry turns to the camera and says "Isn't he a bit terrific?"
In Hallmark's Alice in Wonderland the white rabbit turns to face the camera after being hit time after time with pieces of slate from his roof and raises his eyebrows at the audience.
Subverted in Mr. & Mrs. Smith, when Mr. Smith turns to wink at the camera at one point, only to then reveal he was winking to an old couple next to him.
Oliver Hardy wouldn't talk to the camera, but he often gave it pessimistic or exasperated looks when things were going wrong.
At the end of High School Musical 3: Senior Year, the main characters run across a field at the end of their graduation ceremony, jump out of the "screen" and onto a theater stage complete with red drapes and then grin for five minutes straight as the camera zooms up on each one of their faces.
In Kick-Ass the main character narrates the whole thing, discussing superhero tropes with the audience as they come up and at one point telling the audience off for assuming he'll survive because he's narrating, mentioning other films where that's not the case.
Rubber opens up with a cop talks directly to the camera about how things happen in films for "no reason," and dedicates the film to that tradition. It turns out he was addressing a crowd of spectators, though his statements apply to the actual film as much as the in-universe film.
In House of Wax (1953), there is a hawker playing with paddleballs ushering people in to see the titular building. As he interacts with the crowd, he eventually turns to directly interact with the camera and addresses people in the movie theater as well ("...Well there's someone with a bag of popcorn!").
Further, in a Moment of Awesome, is the fact that the original House of Wax was released in 3D, so not only is the crier speaking directly to the viewers, but his warnings that he might accidentally hit someone in the audience with one of the bouncing paddleballs becomes a very clever use of 3D.
In the 1978 Superman: The Movie film and all its sequels, the final scene always shows Superman looking and smiling at the audience as he flies away.
In an earlier scene, Clark and Lois are in danger of being mugged, but disaster is averted when the gun seemingly misses her and the crook dashes off. Clark collapses, but it soon turns out he only fainted in shock from the gunshot. When Lois turns away, annoyed, Clark opens his hand to reveal he caught the bullet before it hit her and gives the audience his classic "Just between you and me" sort of smile.
In The NeverEnding Story, the Childlike Empress explains that Atreyu brought the Savior after all, since Bastian has been following Atreyu via his emotional investment in Atreyu's story. "And as he is sharing your story," she adds, "others are sharing his"—implying the audience that has watched this far.
Movie trailers have often broken the fourth wall, either in out of character contexts (such as the famous trailer for Psycho featuring Alfred Hitchcock giving a tour of the Bates House), or in character, such as Pierce Brosnan in GoldenEye addressing the audience, "You were expecting someone else?".
Inspector Gadget: Uses this in a very unsubtle way. The nostalgia critic gets suitably annoyed when reviewing the film. (See Here)
In the middle of Justin Bieber's documentary-concert film Never Say Never, the singer and Jaden Smith break the fourth wall by telling the audience to pay attention to the film, and to stop making out in the back row of the cinema.
Played seriously, and not exactly discreetly, in Oliver Stone's JFK - Near the end, when Jim Garrison (Kevin Costner) is wrapping up his speech as to why he believes there is a conspiracy, and how the documents supporting that might one day be available to the public if the demand for the truth is loud enough, his gaze shifts to the viewer; "It's up to you."
Walking with Monsters: Life Before Dinosaurs breaks the Fourth Wall rather often, having creatures walk up to and often interact with the 'camera'. And occasionally leave spit on the lens.
In "Treasure Of The Sierra Madre" the old prospector Howard (Walter Huston) is being wined and dined by indians for saving a child. He's swinging in a hammock, being fed meat and fruit and Tequila. Then a beautiful woman lights a cigarette for him and rubs his beard. He looks directly into the camera and shudders with amazement at his good fortune.
In-universe aversion: near the end of M*A*S*H, Hawkeye is in Seoul to try to rescue Ho-Jon from the South Korean draft board. A news crew is taking interviews on the street of American servicemen, and the interviewer keeps saying "Don't look at the camera" (which would have broken the fourth wall for the viewers of the newsreel footage).
In Lord of War the Book Ends feature Yuri talking directly to the audience.
In Man of the House a short, unexpected, brilliant one after the new air conditioning unit is installed.
Get on Up seems to play around with this trope a bit. As his career progresses, James Brown will sometimes turn and speak directly to the camera, only occasionally interacting directly with his environment in order to further his explanations and theories. He never directly addresses the audience, or makes any sort of acknowledgement that he is in a movie (although, this IS a biographical drama, so such an idea would be in poor taste anyway), so it could be argued that this is simply his inner monologue, and not an example of this trope at all. Ultimately, it's up to you whether this is Brown talking to himself, or indirectly addressing the future generations who will pursue his history.
R100: Starting at about the halfway mark, the film will occasionally cut to a focus group walking out of a movie theater to sit and discuss the film's plot so far. They obviously hate the film and point out many of the film's plot holes.
Alexander Nevsky (1938) is a Russian historical drama about the defeat of an invading German army in the Middle Ages. At the end, Alexander makes a speech about how people who forget the victory are Judases. He looks at the audience several times.
Random Fish: All secondary characters come with me.
"Gremlins 2: The New Batch" has Hulk Hogan threatening the Gremlins for screwing with the film. The film you're watching, in the theater. Right now. Hulk then apologizes to the audience for breaking the movie.
The home release of the film has the Gremlins messing with your VCR instead.
In The Big Short, Jared Vennett (Ryan Gosling) breaks it frequently to address the audience, sometimes in the middle of a scene. Other characters do this as well, although not quite as much.
Gozu: The actress playing the gas station attendant's wife spoke hardly any Japanese and had to speak her lines phonetically. After suffering through her terrible delivery, one of the other actors breaks character to criticize her hopeless acting.
In Shirley Valentine, adapted from a one-woman stage show, Shirley frequently addresses the audience directly, commenting on the action (and sometimes on the presentation — at one point, while being seduced on a boat with nobody but the two of them for miles, she gets distracted wondering where the romantic music is coming from).
Trance: Simon Newton directly addresses the audience at the beginning of the film, serving as our narrator.
Deadpool doesn't so much break the fourth wall as take a bulldozer to the wall, burn it, and then exploding the ashes.
Deadpool:(breaking the fourth wall in a flasback that he's already narrating to the audience) Hey! Breaking the fourth wall while breaking the fourth wall! That's like...sixteen walls.
A Guide To Recognizing Your Saints has a sequence in the 1980s flashback where the supporting cast individually address the audience to announce their motivations. The entire film has a Framing Device of the story being told at a book reading, giving it a weird justification.