Working through a text on ODE's I came across following theorem and its proof, where $E$ is a Banach-space and $D$ an open subset of $E$.

Please remind me of why the first statement of the proof is true, i.e., why does equality of two solutions to an ODE on any non-empty compact subinterval of both their domains imply that they agree on the whole of the intersection of their domains?
What is the general form of the statement that applies to this situation?
General statement: suppose $f$ and $g$ are two functions on an open interval $J\subset\mathbb{R}$, and fix $t_0\in J$. If $f$ and $g$ agree on every compact subinterval $I\subset J$ that contains $t_0$, then they agree on $J$.
Proof: $J$ can be written as a union of compact intervals that contain $t_0$.
This step has nothing to do with differential equations.