beat one's head against a wall

[beat one's head against a wall] {v. phr.} To struggle uselessly against something that can't be beaten or helped; not succeed after trying very hard.

Trying to make him change his mind is just beating your head against a wall.