The shell bone script of character Jail or Prison is
Original meaning of the character is a cowshed alike where ox are fenced or held. If there was a door or bars blocks the ox is unknown.
The bronze script of character Jail or Prison is
similar to shell bone script.
The big seal script of Jail or Prison is
The small seal script of Jail or Prison is
Now we see there is a bar blocking the cowshed.
When people used the cowshed to jail people is unknown, but at least before the small seal script was created, which is in Qin Dynast, 221 B.C.
The clerical script of Jail or Prison is
Its Pinyin is Lao2.
There is another character 囚 - Prisoner (Post 79), which is exchangeable with 牢. However, 囚 has the meaning of Prisoner, but 牢 most of time is Jail. So there is a little bit difference.