Compressibility factor                     Z=pV/RT 
                    p=pressure of the gas 
                    V=real volume of the gas
                    R=universal gas constant
                    T=absolute temperature

My question is that whether p is real pressure of the gas or ideal pressure of the gas...It is mentioned nowhere..If it is real pressure than we cannot apply ideal gas equation and cannot write Z=Vreal/Videal..but in actual compressibility factor is also defined as the ratio of real volume of gas /ideal volume of gas..How it is derived.And please mention whether  p is considered as ideal pressure or real pressure....
 A: Yes, the CF is a way of comparing RGs and IGs kept at same temperature and pressure. It is a comparison of volumes, as stated in the question. Hence the name "compressibility factor".
The CF equation can be better stated as: $P_{obs}V_{m,obs}=ZRT_{obs}$, where the m stands for "molar", and "obs" means "observed". This is in contrast with $P_{obs}V_{m,expected}=RT_{obs}$, the real gas equation.
We can write the real gas equation in this form as well, changing the identity of the observed values: $P_{expected}V_{m,obs}=RT_{obs}$. Here what I did was I decided to measure T and V instead, and "expect" a value for P. We can do the same thing for T.
Basically your confusion is in the fact that "real" and "ideal ("observed" and "expected") values are not well defined. The "real" value will be the "ideal" value for two out of the three variables. We can choose to "observe" two variables, and "expect" the third by ideal gas law, or we can "observe" the third as well by applying compressibility factor and verifying. Here, the variable you are trying to determine is volume, so "real pressure" is "ideal" pressure
What I mentioned in the comments about CF being the same for two pressures comes from this:
.
Yes, it's in Italian, but basically it relates Z(y-axis), reduced pressure (x-axis), and reduced temperature (the T markings on each curve).
From here, it is obvious that, for different values of T or P, it is possible to have different values of Z. One should be careful about this while calculating stuff, that's all.
