Let $E$ be a topological space and $A\subset E$ how to find a necessary and sufficient condition for the continuity of the function $\chi_A: E\rightarrow\mathbb{R}$ where $$ \chi_A(x)= \begin{cases} 1, ~x\in A\\ 0,~x\not\in A \end{cases} $$
If i suppose that $\chi_A$ is continuous then $$\forall\varepsilon>0, \exists V\in \mathcal{V}_x, \chi_A(V)\subset ]\chi_{A}(x)-\varepsilon, \chi_A(x)+\varepsilon[$$ or $$\forall\varepsilon>0, \chi_A^{-1}(]\chi_{A}(x)-\varepsilon, \chi_A(x)+\varepsilon[)\in \mathcal{V}_x $$
How to find a condition on $A$?
Thank you