# Continuous function crosses the boundary?

Let $X$ be a topological space, $E\subset X$, and $g:[a,b]\to X$ is a continuous function where $g(a)\in int(E)$ (interior) and $g(b)\in ext(E)$ (exterior).

I want to prove that $g([a,b])\cap\partial E\neq\emptyset$. (where $\partial E$ is the boundary of $E$)

This is what I've done :

Suppose $g([a,b])\cap\partial E=\emptyset$, then $f([a,b])\subset int(E)\cup ext(E)$, and therefore $g^{-1}(int(E)\cup ext(E))=[a,b]$, meaning $[a,b]=g^{-1}(int(E))\cup g^{-1}(ext(E))$, the union of two disjoint open sets (since $f$ is continuous and $int(E)$ and $ext(E)$ are open). However, because $[a,b]$ is a connected set, this is contradictory, and therefore $g([a,b])\cap\partial E\neq\emptyset$.

I feel like I missed something, is this correct ?

Why do you sometimes write $f(x)$? It should be always $g(x)$.
Also $g([a,b])\subset int(E)\cup ext(E)$ means $[a,b]\subset g^{-1}(int(E))\cup g^{-1}(ext(E))$ because $[a,b]\subset g^{-1}g([a,b])$.
• Force of habit, my brain seems to think a function has to be named $f$. Will edit the post. Thank you ! – dantheman Apr 13 '15 at 23:18
• Can't I conclude that $[a,b]=g^{-1}(int(E)\cup ext(E))$ though since I also, by the definition of a function, have $g^{-1}(int(E)\cup ext(E))\subset [a,b]$ ? – dantheman Apr 13 '15 at 23:28
• It can be concluded that $[a,b]\subset g^{-1}(int(E))\cup g^{-1}(ext(E))$. Apply $g^{-1}$ to both sides of $g([a,b])\subset int(E)\cup ext(E)$, and use fact that $[a,b]\subset g^{-1}g([a,b])$. – Math Wizard Apr 13 '15 at 23:31