Welcome and thank you for allowing me to assist you! The clutch coil is failing and that is why the clutch will not stay engaged. Yes replacing the compressor will take care of this. Now you could just replace the clutch and coil, but I have had mixed results doing it that way, so I recommend replacing the compressor just to be sure of the repair.
I hope this information helps and let me know if you need further assistance with this.