No, you do not need a rooster for a hen to lay an egg. Hens will lay eggs regardless of whether there is a rooster present or not. However, without a rooster, the eggs will not be fertilized and will not develop into chicks.
If you do want to breed chickens and have fertilized eggs, then you will need a rooster. The rooster fertilizes the eggs by mating with the hens, and the fertilized eggs will develop into chicks if they are incubated or left under a broody hen.
However, if you are only interested in having chickens for their eggs, then you do not need a rooster. Hens will lay eggs without a rooster present, and the eggs will be perfectly fine to eat.
It's worth noting that having a rooster around can sometimes have benefits for the hens. Roosters can act as protectors, warning the flock of potential predators and defending them if necessary. Roosters can also help to establish a pecking order among the hens, which can help to reduce aggression and keep the flock calm and content.
However, roosters can also be noisy and aggressive towards people, especially during breeding season. In addition, if you have neighbors, a rooster's crowing can be a nuisance. Therefore, it's important to consider your specific situation and needs before deciding whether or not to keep a rooster with your hens.
In summary, while a rooster is not necessary for hens to lay eggs, it can have some benefits for the flock. However, if you are only interested in having chickens for their eggs and do not want the added responsibilities of a rooster, then you can certainly keep hens without one.