I learned once upon a time that a healthy person needs about three weeks to starve to death if they have water. Not sure how accurate it is as it's part of the rule of three mnemonic; 3 minutes without oxygen, 3 days without water, 3 weeks without food. However, it does at least seem reasonably plausible, so we can use that as a baseline.
Now, beer does have some nutrients, but far from enough of the ones you need. It has to be balanced with water to be able to burn the alcohol without dehydrating yourself. I would therefore think that the beer in moderate amounts might help some, but not a lot. Four weeks total, maybe?
It really depends on your starting weight too. A really obese person with only water and beer could go far longer than 3 weeks, probs 6 months or more. They'd start getting in trouble when they exhausted their fat soluble stores of AEDK.
Protein I think would be the issue. There was a case study on a morbidly obese guy that did this with doctors. What I remember is he basically told his doctor he was going to stop eating entirely. They could either help him and give him medical advice along the way, or try to just advise against and he was going to do it anyways. He would take a daily vitamin for general vitamins and I believe some yeast paste to give him protein. I think the dude lost like 400lbs in a year. Had small bowel movements every 30 to 40 days.
Edit: Apparently it wasn't protein but amino acids.
he consumed only vitamins, electrolytes, an unspecified amount of yeast (a source of all essential amino acids)
If you have large stores of fat your body won't catabolise protein until it's basically exhausted. It's pretty good at prioritising carbs, then fat then protein. When it's using protein for energy, you're essentially destroying your muscles and tissue, which is very bad.
I've never heard the yeast paste for protein part of this story before. Every time I've seen it repeated it was just salt and minerals he was supplemented.
Depending on how broadly we define beer here, you could totally end up with one with a surprisingly high protein content. Certainly not enough to live forever on, but I'd bet you could get a lot further than you'd initially think. People can go a long time on just bread, don't see why liquid bread would be much different
I think you would be fine for a long time if you drank old-style beer. Unfiltered, low alcohol content, some remaining sugar/starch and with lots of yeast, maybe some impurities that probably contain amino acids, vitamin b12 and other important stuff.