Let be $\Omega \subset \mathbb{R}^n$ an open set. I want to show that if $u: \Omega \longrightarrow \mathbb{R}$ is a measurable function, then $\text{supp} \ u = \overline{\{x \in \Omega ; u(x) \neq 0\}}$.
The definition of $\text{supp} \ u$ is the following:
Let be $\Omega \subset \mathbb{R}^n$ an open set, $u: \Omega \longrightarrow \mathbb{R}$ is a measurable function, $\{ \mathcal{O}_i \}_{i \in I}$ a family of all open sets of $\Omega$ such that $u(x) = 0$ $\lambda$-a.e. ($\lambda$ denotes the Lebesgue measure on $\mathbb{R}^n$) in $\mathcal{O}_i$ for each $i \in I$. Consider $\mathcal{O} = \bigcup_\limits{i \in I} \mathcal{O}_i$, then $u \equiv 0$ $\lambda$-a.e. in $\mathcal{O}$. The support of the function $u$ is defined by $\text{supp} \ u := \Omega \backslash \mathcal{O}$.
The result is apparently simple by the definition of closure, because
$$\text{supp} \ u := \Omega \backslash \mathcal{O} = \bigcap_\limits{i \in I} \mathcal{O}_i^c,$$
$\mathcal{O}_i^c$ are closed sets and $u \not\equiv 0$ in $\text{supp} \ u$, but it is possible exist points in $\mathcal{O}_i$ for some $i \in I$ such that $u$ doesn't vanish, then the support would be a proper subset of $\overline{\{x \in \Omega ; u(x) \neq 0\}}$. Probably, I need to use the continuity of $u$ here, but I can't see how to use it. I see this topic while I was writting my topic and I thought it is just consider $f = u$ and $g \equiv 0$ in the topic linked to solve my problem. Is really just do this?
I would also like a counterexample to convince me to the result doesn't remain if $u$ is not continuous. I tried construct a counterexample, but I couldn't verify if it satisfy the condition on $\{ \mathcal{O}_i \}_{i \in I}$. The counterexample that I tried to construct is
$$\begin{align*} u: (0,1) &\longrightarrow \mathbb{R}\\ x &\mapsto u(x) := \begin{cases} 0, (0,1) \cap \mathbb{Q}\\ 1, (0,1) \cap \mathbb{R} \backslash \mathbb{Q} \end{cases} \end{align*}$$
Thanks in advance!