A man has pleaded guilty to murder after attacking his former partner and inflicting a horrific brain injury that killed her five months later.