“Beating a dead horse” is an idiom that means continuing to do something that is pointless or has no chance of success. The phrase comes from the futile image of striking a horse that is already dead.
A similar expression, “flogging a dead horse,” carries the same meaning. “Flog” means to whip or beat, so both phrases describe wasting effort on an already settled or hopeless matter.