Suppose $\Omega$ is a smooth open bounded domain in $\mathbb{R}^n$. Is $C_0(\Omega)$ a subset of $C(\overline\Omega)$?
I think it is not because I can take $\Omega = (0,1)$ with $f(x) = \frac{1}{x}$ on $(0,1)$ and $f(0) = f(1) = 0$. Am I right? I'm not so sure about it since it may involve the trace of the function, and the compact support.
Thank you.
Note that a function $f$ in $C_0(\Omega)$ is defined on $\Omega$ only, so it does not really make sense (yet) to talk about $f|_{\partial\Omega}$.
Usually, $C_0(\Omega)$ is defined as the completion of $C_c^\infty(\Omega)$ in $C(\Omega)$ with respect to the uniform norm. In this case, this set is exactly the set of functions that vanish near the boundary, that is $f(x)\to0$ when $x\to\partial\Omega$. In particular, it is possible to extend $f$ to a continuous function $\overline f$ on the closed set $\overline\Omega$ such that $\overline f|_\Omega =f$, and this extension is unique. Thus, the application $$ \begin{array}{ccl} c:&C_0(\Omega)&\to C(\overline\Omega)\\ & f &\mapsto \overline f\\ \end{array} $$ being injective, we can identify $C_0(\Omega)$ to its image $f(C_0(\Omega))$, which is a subset of $C(\overline\Omega)$.
Likewise, using $$ \begin{array}{ccl} r:&C(\overline\Omega)&\to C(\Omega)\\ & f &\mapsto f|_\Omega\\ \end{array} $$ that is also injective, we can identify $C(\overline\Omega)$ to a subset of $C(\Omega)$. In that sense, we can say that $$ C_0(\Omega)\subset C(\overline\Omega)\subset C(\Omega) $$ all of these inclusions being strict, since the constant function $1\in C(\overline\Omega)\backslash C_0(\Omega)$, and, as you noted, any continuous function that diverges near the boundary (like $x\mapsto 1/x$), cannot be extended to a continuous function on the closure of $\Omega$, and thus is in $C(\Omega)\backslash C(\overline\Omega)$.