dead horse to death, beating a

(colloquial) continuing to try to get satisfaction from something that cannot or can no longer give it. From a person who beats a horse to make it go even though it is dead, thus doing something that is completely useless.