Literally, “to beat one's head against the wall”.
bàttere il capo nel muro (first-person singular present bàtto il capo nel muro, first-person singular past historic battéi il capo nel muro, past participle battùto il capo nel muro, auxiliary avére)