Preheat the oven to 450 degrees . Mix the caraway seeds with 1 teaspoon each salt and pepper and season the pork shoulder with the spice mixture.
In a medium roasting pan or large Dutch oven, heat the oil over medium heat. Place the pork in the pan and brown on all sides, turning occasionally, 15 to 20 minutes total. Add the onions, carrot and celery and cook, stirring occasionally, until the vegetables begin to caramelize, 8 to 10 minutes. Add the garlic and cook for 2 minutes.
Add the beef broth to the pan and pour the beer over the meat. Transfer to the oven and roast, basting occasionally with the juices, until the center of the pork registers 155 degrees on an instant-read thermometer, 1 1/2 to 2 hours. Transfer the meat to a platter, tent loosely with foil and let stand.
Strain the pan juices into a large heatproof bowl, pressing on the solids to extract any liquid. Skim the fat off the top, then pour the juices into a saucepan. Stir the flour into 1/4 cup water to form a paste. Whisk the paste into the pan juices and cook over medium heat, whisking constantly, until thickened. Season with salt and pepper.
Slice the pork shoulder and serve with the pan gravy.