Does one in jail need to put a mezuzah on his cell? Assuming this is a standard American jail.
If it is a jail owned by a Jew, is there an obligation on the inmate or the owner?
This is actually addressed by the Chida in his Birkei Yosef 286:3. He brings the Bais Hillel(not to be confused with Bais Hillel from the gemara) who holds that a jail is not a dwelling of honor,so would be patur from a mezuzah. He also brings a proof from the gemara Yoma 10b which seems to imply that a jail would not require a mezuzah.
The Chida himself seems to disagree with the proof from the gemara and on the grounds of it being a dira l'kovod it would require a mezuzah. (The Shaar Ephraim also implies this).
However, the Chida ends off saying that maybe a jail would be exempt on premise that it's not made for permanent dwelling and only temporary like a boat dwelling. However, it seems that its inconclusive.
Text of the Birkei Yosef:
R Gersion Appel here answers your question
A Jew who is serving a sentence does not require a mezuza on his prison cell, as it is not deemed a respectable residence and it is unlikely that he would consider it his permanent dwelling.
This is based on Kitzur Shulchan Aruch 11:14
A house that is not designated for permanent dwelling does not require a mezuzah
This is also in line with the first view described by yeshiva.co.il here. See there for further analysis.
I found a new and unusual source. R Ephraim Oshry was the Rav of the Kovno ghetto during the second world war and one of the few European rabbis to survive the Shoah. He published a set of responsa written during the war, in terribly difficult circumstances (published in English as Responsa from the Holocaust but long out of print, for some reason the French translation is still available).
In one of the responsum (#51 in French edition), he is asked if the houses of the ghetto need mezuzot, when the ones on the doorposts are too damaged to be valid. He writes (I translate from the French)
Because it was impossible to enter or leave the ghetto without the Germans knowing, since the ghetto was surrounded by barbed wire and guards with machine guns preventing to get near the wire, the ghetto residents were prisoners. The underlying question is therefore whether a prison cell is subject to the obligation of mezuza?
His answer is that only a permanent residence needs a mezuza. Since the ghetto was such a terrible place to live in, its residents would have left as soon as possible if allowed to do so. Therefore he ruled the rooms and houses did not need a mezuza, and if someone wanted to affix one, it should be without a blessing.
Leket Hakemach (YD, Mezuzah s.v. Kahal) explains Shaar Ephraim (83) that one who is in a Jewish jail [for several months] is required to affix a mezuzah. His reasoning is that Rambam (Mezuzah 6) did not enumerate a jail as one of ten things which do not require a mezuzah. Shaar Ephraim also brings proof from the Rabbi’s opinion in Yoma (10b) that even one living against their will is still considered a regular living place, and is required to affix a mezuzah.