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.
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.
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 tomaOto 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 "Amelie", 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.
The bad guy Hedley Lamaar is considering his orders to find a new sheriff for the town of Rock Ridge.
Hedley Lamaar: A sheriff! But law and order is the last thing I want. Wait a minute... maybe I could turn this thing into my advantage. If I could find a sheriff who so offends the citizens of Rock Ridge that his very appearance would drive them out of town. (looks into the camera) But where would I find such a man? (pause) Why am I asking you?
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: "I'm working for Mel Brooks!" (writer/director).
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!"
NB: this is right after they read his name in the credits.
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."
In Spaceballs, 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.)
Also in Spaceballs, 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."
In Jay and Silent Bob Strike Back, 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.
I always thought he was looking at the murals on the ceiling of the church. A Take That to God (I am in ur church, boylin ur holi water).
Could be a nod to the final shot of The Omen, in which five-year-old Damien, attending his adoptive parents' funeral, looks directly at the audience and smiles.
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.
....prompting the callback, "Who the fuck are you talking to?! Who the fuck are WE talking to?!"
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.
In Fatal Instinct, after Ned Ravine finds his skunk missing the camera follows him. As it does so it runs into a tree and the lens breaks.
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."
High Fidelity. John Cusack's character talks directly to the audience as he talks about his life, relationships and love of music.
Austin Powers 2: The Spy Who Shagged Me. Basil tells Austin that he should stop worrying about Time Travel complexities and just enjoy himself, then turns to the audience and says “That goes for you all too!” and Austin says "Yes".
Austin Powers 3: 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. and 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.
The teaser trailers for "Marmaduke", "Kung Fu Panda 2" and "Ratatouille" all have the main characters break the fourth wall.
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 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 Empire Strikes Back when several characters are escaping from the collapsing rebel base, the door closes on C-3PO, who turns to the camera and mutters "How typical." The door opens again and he's pulled out by Han. This is the only moment in the entire series to break the fourth wall.
Threepio turns more past than towards the camera, and he has a habit of muttering to himself when annoyed, like the cantankerous old droid he is. He has a monologue about how R2-D2 tricked him while walking alone through the desert in A New Hope.
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 Mash, 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.