Condition of continuity of characteristic function. Let $E\subseteq \mathbb{R}$ Then the characteristic function $\chi_E : \Bbb R \to \Bbb R$ is continuous iff E is clopen. 
Please provide me some hints or proof of above result.
 A: $\mathbb{R}$ is connected so $E\subset\mathbb{R}$ is clopen iff $E=\emptyset$ or $E=\mathbb{R}$. Now $\chi_\emptyset:\mathbb{R}\to\mathbb{R}$ is the constant function $=0$ and $\chi_\mathbb{R}:\mathbb{R}\to\mathbb{R}$ is the constant function $=1$. Both are continuous
If $\chi_E$ is continuous at $x\in\mathbb{R}$ then, because $\chi_E$ only takes values in $\{0,1\}$, there is some interval $(x-\epsilon,x+\epsilon)$ where $\chi_E(t)=\chi_E(x)$ for all $t\in(x-\epsilon,x+\epsilon)$. This means $(x-\epsilon,x+\epsilon)\subseteq E$ if $x\in E$ so $E$ is open. By the same reasoning on $\mathbb{R}\setminus E$ and noting that 
$\chi_{\mathbb{R}\setminus E}=1-\chi_E$ is also continuous, $\mathbb{R}\setminus E$ is open and $E$ is closed $\implies E$ is clopen 
A: Let $E\subseteq \mathbb{R}$ then the characteristic function $\chi_E : \Bbb R \to \Bbb R$ is defined by $\chi_E$ = $1$  if  $x \in E$ and $\chi_E$ = $0$  if $x  \in E^c $. If $\chi_E$ is continuous then inverse image of closed set must be closed. So $f^{-1}(\{0\}) = E$ is closed and $f^{-1}(\{1\}) = E^c$ is closed. This implies $E$ is open and closed both. If $E$ is both open and closed then $\chi_E$ is continuous. Am I right ?
A: The function $\chi_E$ is open iff $\chi_E^{-1}(U)$ is open for every open $U$. We can write out what $\chi_E^{-1} (U)$ is in four cases.


*

*If $0, 1 \not \in U$, then $\chi_E^{-1}(U) = \emptyset$.

*If $0 \in U, 1 \not \in U$, then $\chi_E^{-1}(U) = E^\complement$.

*if $0 \not \in U, 1 \in U$, then $\chi_E^{-1}(U) = E$.

*If $0, 1 \in U$, then $\chi_E^{-1}(U) = \mathbb{R}$.
So while $\emptyset, \mathbb{R}$ are always open, we also need $E, E^\complement$ to be open. This’ll happen iff $E$ is clopen.
