Let $U \subset \mathbb{R}^n$ be open and connected (equiv. path connected), and let $f : U \to \mathbb{R}$. Is it true that if $f$ is continuous on all paths, that is, if for all continuous $\gamma : [0,1] \to U$, $f \circ \gamma$ is continuous, then $f$ must be continuous?
If this is true, could we weaken the hypotheses on $U$ in any nice way?