The Chasam Sofer: 'Minhag Yisrael Torah Hee'
Asked whether a Sefer Torah was written by a Jew, the Chasam Sofer replies with a pun: check the last column, where Jewish custom has many people write letters.
The story is told that someone approached the Chasam Sofer with a dilemma. This man had a Torah scroll in his possession, but he was unsure if the scribe who wrote it was Jewish, or if perhaps it was written by a gentile for his private collection. The Chasam Sofer cryptically replied, “Minhag Yisrael, Torah hee.” The phrase usually means that a custom that is followed by Klal Yisrael has the import of a Torah law. However, here the Chasam Sofer was actually making a play on words.
There is a custom that when a sefer Torah is completed, many people are invited to write one of the final letters. Hence, one can easily ascertain if a Torah was written by a Jewish scribe by turning to the end of the Torah and checking if the writing in the last column is uniform with the rest of the scroll. If it is not uniform, then it was commissioned by a Jewish person who followed the minhag of allowing various people to write letters in the last column. So the Chasam Sofer was implying that if minhag Yisrael was followed, then it is a kosher Torah.