what is the relation of smooth compact supported funtions and real analytic function? What is the major difference between real analytic and test function (smooth compact supported functions). Can we find a real analytic function $f$ on $\mathbb R^n$ which is also smooth compact supported? If not then need a proof.

If by "test function" you mean a smooth function with compact support (as opposed to a Schwarz function), then the answer is no. Consider an analytic function $f \in C_c^\infty(\mathbb R^n)$ and a point $x$ outside of its support. Because $f$ is analytic, it must equal its own Taylor series developed at $x$, i.e. $0$, and since the radius of convergence is infinite, $f$ must be the zero function.
The upshot of this is that analytic functions are very rigid objects. Loosely speaking, perturbing an analytic function in a single point causes global changes to "ripple" out from the perturbation in order to preserve analyticity.
