$C_p(X)$ is a dense subspace of $\Bbb R^X$ 
The topology of $C_p(X)$ ($C(X,\Bbb R)$ with the topology of pointwise convergence) coincides with the topology induced in $C(X, \Bbb R)$ from the Tychonoff
  product $\Bbb R^X$, that is, $C_p(X)$ is a subspace of $\Bbb R^X$.

Now if $X$ is a Tychonoff space, I can show that $C_P(X)$ dense in $\Bbb R^X$. Is this statement true?

$C_p(X)$ dense in $\Bbb R^X$ for any topological space $X$.

 A: To show that $C_p(X)$ is dense, you want to find a continuous function such that for given finite number of points it takes values in prescribed open sets. This can be done for $X$ Tychonoff but not generaly. For $X$ indiscrete $C_p(X)$ are only constant functions. More generaly if $X$ contains two points which cannot be functionaly separated then any $f ∈ C_p(X)$ must take the same value on those points and so $C_p(X)$ is not dense. So $X$ has to be completely Hausdorff.
Actually it can be proved that being completely Hausdorff is also sufficient condition. Let $F ⊆ X$ be finite and $U_x$ nonempty open in $\mathbb{R}$ for each $x ∈ F$. We want $f ∈ C_p(X)$ such that $(∀x ∈ F): f(x) ∈ U_x$. Actually we can choose any $y_x ∈ U_x$ and find $f$ such that $(∀x ∈ F): f(x) = y_x$. First, by complenete Hausdorffness we can find continuous function which takes $1$ on $x$ and $0$ on $x'$. This can be done for any $x' ∈ F \setminus \{x\}$. Product of these function takes $1$ on $x$ and $0$ on other members of $F$. This can be done for any $x ∈ F$. Linear combination of these functions is desired $f$.
So $C_p(X)$ is dense in $\mathbb{R}^X$ if and only if $X$ is completely Hausdorff.
A: It's not. Consider $X=\{a,b\}$ with the trivial topology. Then $C(X,\mathbb{R})$ consists only of constant functions. Now take $f\in\mathbb{R}^X$ such that $f(a)=0$ and $f(b)=1$ and consider an open neighbourhood of $f$ like $\{a\}\times(-0.5,0.5)\cup\{b\}\times(0.5,1.5)$.
