Much worse than this is possible, which you can see by using #1 & #2 below.
1. There exist functions $f:{\mathbb R} \rightarrow {\mathbb R}$ such that the graph of $f$ is dense in ${\mathbb R}^2.$ (In fact, this can even be the case for a Baire $2$ function.)
See, for example, these StackExchange questions:
Graph of discontinuous linear function is dense
Does there exist a function $f:[0,1] \to[0,1]$ such its graph is dense in $[0,1]\times[0,1]$?
graph is dense in $\mathbb{R}^2$
2. Given any function $f:{\mathbb R} \rightarrow {\mathbb R}$, there exists a subset $D$ of $\mathbb R$ such that $D$ is dense in $\mathbb R$ and $f$ restricted to $D$ is continuous.
For this result, see the following:
Every real function has a dense set on which its restriction is continuous [mathoverflow question]
Jack B. Brown, A measure theoretic variant of Blumberg's theorem, Proceedings of the American Mathematical Society 66 #2 (October 1977), 266-268.
google search for "Blumberg" and "dense" and "continuous"