It is a theorem due to Blumberg (New Properties of All Real Functions — Trans. AMS (1922)) and a topological space $X$ such that every real valued function admits a dense set on which it is continuous is sometimes called a Blumberg space.
Moreover, in Bredford & Goffman, Metric Spaces in which Blumberg's Theorem Holds, Proc. AMS (1960) you can find a characterization of Blumberg spaces. Chapter 8 of the book Homeomorphisms in Analysis (mentioned by Gro-Tsen in the comments, and available here) gives examples of Baire spaces which are not Blumberg spaces.