Let $u: [0,b[ \to \mathbb{R}^n$ be a continuous function, and suppose that $u(0) \in A$ where $A$ is a compact set. If $u([0,b[) \not\subseteq A$, prove that there exists $x \in [0,b[$ such that $u(x) \in \delta A$, the boundary of $A$.
My attempt:
I drew a picture, and this gave me some intuition about what a possible proof would be.
I defined $V:= \{x \in [0,b[: u(x) \notin A\}$, $W:= \{x \in [0,b[: u(x) \in A\}$
and defined $w = \sup W, v = \inf V$. I can show that $v \in \overline{X \setminus A}$ and $w \in \overline{A}$, using the continuity of $u$ so if I can show that $v = w$, I'm done.
Any ideas for a proof? (Maybe the compactness of $A$ isn't fully required, this problem comes from a proof in a differential equation book)
It is true in general topological spaces. The crucial property is the connectedness of the domain of $u$.
For $Y$ is the disjoint union of $\operatorname{int} A$, $Y \setminus \overline{A}$, and $\partial A$. Thus
$$X = u^{-1}(\operatorname{int} A) \cup u^{-1}(Y \setminus \overline{A}) \cup u^{-1}(\partial A)\,,$$
and the union is disjoint. By assumption, the first two sets are nonempty, and by continuity they are open. Hence if we had $u^{-1}(\partial A) = \varnothing$, that would give a decomposition of $X$ into two disjoint nonempty open sets, contradicting the connectedness of $X$.