The Fool shows up late in Act I, after Lear has made his mistake and given his kingdom and his power to his two ungrateful daughters. He has also disowned the third daughter, Cordelia, who actually loves him. By the time the Fool appears on the scene, Goneril has already turned on Lear, and Lear is making plans to leave her court.
The Fool's role is to function as a truth teller, as Cordelia did earlier. He tells Lear what the audience already knows, that he should never have given away his power. He tells Lear that he is a fool, and tells him not to believe everything he hears. When Lear asks, are you calling me a fool, the Fool says: "All thy other titles thou hast given away that thou wast born with."
He also warns Lear that he will get no better reception with his daughter Regan than with Goneril, another bit of truth.