Fugacity is defined as thermodynamic pressure, which is used to find the properties of real component by deviation from its ideal gas properties. For an ideal gas f = P and fi = yiP for ideal gas solution.
Activity is relative fugacity, which is the ratio of fugacity to fugacity in standard state.
Fugacity is generally used to find the deviation in gaseous phase while activity is used to find deviation in liquid and solid.
The gas phase or vapor phase property is calculated by using fugacity coefficient while the liquid phase property is calculated by using activity coefficient.