"Beating a dead horse" is a phrase that means to continue to do something that is pointless or has no chance of success. It comes from the idea of beating a horse that is already dead, which is obviously futile.
"Flogging a dead horse" is a similar phrase that has the same meaning. "Flog" means to whip or beat, so flogging a dead horse is another way of saying beating a dead horse.