Proving that $C_{c}(R)$ is not dense in $L^{\infty}(R)$.
My attempt: Let $f=\chi_{(0,1)}$ be in $L^{\infty}(R)$. Then $||f||_{\infty}=1$. Let there be a function $g \in C_{c}(R)$, such that $||f-g||_{\infty}<1/2$.
$$ \{x \in R : sup(|f(x)-g(x))| \} < \epsilon$$
Thus $ |g(1)| < 1/2$, $ |g(0)| < 1/2$, and for $ 0<x<1, |g(x)-1| < 1/2$.
$$-1/2 < g(1) <1/2$$ $$ -1/2 < g(0) <1/2$$ $$ -1/2 < g(x)-1<1/2= 1/2 < g(x) < 3/2$$
Let $x_{n}=1/n, x_{n} \to 0$. By Continuity $g(x_{n}) \to g(0)$. But $1/2< g(x_{n})<3/2$, so as $n \to \infty$, $$1/2 \leq g(0) \leq 3/2$$ But this contradicts that $g(0)<1/2$. Hence proved.
Please let me know if its correct.