The Chinese character, 伍(오), means "five people." It is composed of 亻(인) and 五(오). 亻(인) means "person," and 五(오) means "five," so this character is easy to remember. However, why did the Chinese create a special character to mean "five people," as opposed to some other number of people? I was curious, so I looked it up.
The smallest unit in the armies of Old China was five men, and it seems that when the Chinese would march, they would usually march in ranks of five, which was called an 伍(오). Five ranks would be twenty-five men, which the Chinese called a 行(항). The Korean word for "rank and file" is 항오(行伍).
By the way, the character 行 is pronounced as 행, not 항, when it is used to mean "to walk" or "to do."