Continuous functions equal except on a nowhere dense set Consider two continuous functions $f,g : \mathbb{R} \supset I \to \mathbb{R}^k$ for which every subinterval $J \subset I$ contains a subinterval $K \subset J$ such that $\forall t \in K, f(t) = g(t)$.
Is it then true that $\forall t \in I \setminus E, f(t) = g(t)$ where $E$ is a nowhere dense subset of $I$? If so, can you point me to a solid reference?
Thanks for the help!
 A: I don't have a reference for this, but it's a relatively straightforward application of the definition of a nowhere dense set. That's just to say that I wouldn't necessarily expect to find this recorded in a textbook somewhere, but I'll freely admit I haven't checked.
Here's the proof. To begin, let $\mathcal{J}$ be the collection of all open intervals $J \subseteq I$ where $f \equiv g$ on $J$. Letting $U = \bigcup_{J \in \mathcal{J}} J$, we have that $U$ is open, and $f \equiv g$ on $U$. Now let $F = I \setminus U$, so that $F$ is closed in $I$. Evidently $F$ contains the set $E = \{ t \in I : f(t) \neq g(t) \}$, so the closure of $E$ in $I$ is contained in $F$. As a result, to show that $E$ is nowhere dense it suffices to show that $F$ contains no (non-degenerate) interval.
This follows almost at once from the hypotheses: if $J'$ were an interval contained in $F$, we know there's a sub-interval $K \subseteq J'$ where $f \equiv g$. So then the interior of $K$ is actually in $U$, contradicting it being a part of $F$.
