To recap the idea behind the Rock Ridge series, not everyone is going to be able to live off of the land after a major catastrophe. There will be those who are not suited to raising their own food, but will have other skills that they can use to make a living. I am using the fictional town of Rock Ridge (ca. 1870) as an example of the skills and services that may be in demand after TSHTF. It doesn't have to be “Mad Max Beyond Thunderdome”; people lived comfortably in small towns and villages for centuries before the invention of electric lighting and automobiles.
The jail in Rock Ridge is small, having just two cells in the rear of the building. The front of the building serves as office and living quarters for the sheriff. The widows are covered by bars to provide added security, and the door is solid and can be barred from the inside. A small safe is provided for storing reward funds and other valuables, and there is a rack holding rifles for use by a posse if the members didn't have one of their own. A potbelly stove serves as the source of heat and a way to cook small meals. A cot or small bed next to the stove is where the Sheriff sleeps, unless he had a room at a local boarding house or hotel.
The cells in small town jails were often made of wrought iron, forged by the local blacksmith or brought in from another town. Iron straps or bars were riveted together into walls and anchored to the masonry or each other to make the individual cells. Rough bunks were about the only furnishings provided in the cells. Since running water was scarce, the toilet was an outhouse out back and bathroom breaks for prisoners were limited and done under guard. For dangerous prisoners, a chamberpot would be provided in the cell. The objective of the jail was to protect the safety of the town by locking up dangerous people until a trial, as well as protecting those arrested from vigilante justice.
The existence of a jail presupposes the existence of a system of law and order. This is easier to accomplish in a populated area than in a rural settling. Having a set of rules (laws) that every one agrees to abide by is the basis of any civilization, and having the means to enforce those rules requires a system of courts and police.
Each town or township was either assigned a Sheriff to serve as a local representative of the State (or Territorial) Governor, or the town council would hire one. His law enforcement duties were normally limited to settling minor disputes and arresting law breakers for trial by a judge. Dealing with drunks hasn't changed much over the years; giving the inebriated a safe place to sleep it off and possibly a small fine (or community service) made sense. Civil matters were the concern of the town Marshal, who was normally more involved with the courts and their rulings.
The judicial system in the territories of the American West was much simpler than what we have today. Trial by a jury of peers was the model, and the sheriff was there to ensure that vigilante justice was the exception and not the rule. Capital crimes like murder, kidnapping, etc. were often punished by witnesses before the legal system got involved, but the Sheriff was around to help ensure that a fair trial was a possibility. Lawyers were not common, partly because the laws were simple and could be understood by just about any adult.
Judges were assigned by population. A large enough city would have a permanent courtroom and the cases would come to him, but the more rural areas were served by a “Circuit” judge who traveled from town to town hearing cases as they were needed. A Justice of the Peace would serve small communities as a mediator and judge for minor offenses.
In a true WROL (without rule of law) situation, the residents of a town, township, or neighborhood might find a need to provide their own “law enforcement”. Having a night watchman patrolling the streets, looking out for the residents as they sleep, is an age-old practice. Having someone tend the fire through the night probably dates back to the discovery of fire and there always seems to be a few folks who don't mind being up all night. .
If you're dependable, respected, and can deal with people at their worst then you might make a fair Sheriff. The hours are going to suck, the pay will probably be even worse, and there will be those who take the enforcement of anything beyond “Thou shalt not murder” as a personal affront. The workload will probably resemble most military jobs: long hours of boredom punctuated by moments of sheer terror. Grudges, feuds, vendettas, and just plain crazy people will complicate your job. Some people will hate you while others will love you for doing the job, but you will need to be able to live with both kinds.