Is power the rate of energy flowing in and out a capacitor?
Your friend is right, and so are you.

Power is the derivative of Energy over time. Since the field energy in your capacitor changes over time, there's obviously power needed to effect that.

However, when you look at what happens over a full period (or multiples thereof), the capacitor stores as much energy as it releases; the average (over an arbitrarily large time span) power is zero.

This is the reactive power you'll have heard about. No actual work is done with that power – it just oscillates back and forth between your voltage source and your capacitor.