Definition of completely regular space. 
A regular space is said to be completely regular space if for a closed set $A$ there exists a continuous function$$
f: X \to [0,1]
$$ 
  such that$$
f(A^c)=0, \quad f(A)=1.
$$      

Is this definition valid for completely regular space? If it is not correct then kindly state the correct one.
 A: A quantor over points not in $A$ is missing, and the space is not necessarily assumed to be regular:
A space $X$ is called completely regular iff

for all closed subsets $A \subseteq X$ and all $x \notin A$, there exists a continuous function $f: X \to [0,1]$ such that $f(x) = 1$ and $f[A] \subseteq \{0\}$.

We cannot ask for $f[X\setminus A] = \{0\}$! This would fail for almost all spaces, as it would imply that every closed $A$ is both closed and open.
A completely regular space is automatically regular (we can separate points and closed sets).
We often assume $X$ is $T_1$ (points are closed) as well, and then the property
can be denoted $T_{3\frac12}$. So if regular in your book implies points are closed, then demand that too for completely regular.
A: No.  The definition is that for every closed set $A$ and point $x\notin A$, there is a continuous $f$ from $A$ to $[0,1]$ with $f(x)=0$ and $f(A)=1$.  
What you give is the definition of a space in which every closed set is also an open set....i.e., a space in which each connected component is open and inherits the trivial (indiscrete) topology.
