run (one's) head against a brick wall
To attempt, continually and fruitlessly, to accomplish some task or achieve some goal that is or seems ultimately hopeless. I feel like I've been running my head against a brick wall trying to understand this math equation. Some people are never going to agree with you on this, so it's no use running your head against a brick wall trying to convince everyone.
run one's head against a brick wall
Fig. to be frustrated by coming up against an insurmountable obstacle. There is no point in running your head against a brick wall. If you can't succeed in this case, don't even try. I have been running my head against a brick wall about this problem long enough.