I did my first bicycle race last fall. It was 42 miles. I was very well prepared for the race, but I think that it was probably too far for my first race. They also had a 21 mile race at the same event, and I wish I’d done the shorter one instead. If I do the race again this year, I’m going to do the shorter one. Even though I’d done many 50 mile rides before that race, it’s a different story to ride that far at race pace.
The best advice I can give for someone that wants to ride in a bicycle race is to do organized group rides. There are probably various semi-formal weekly group rides in your area. Ask your local bike shop about any group rides that are at your ability level. Group riding skills are absolutely essential for road racing. Plus, you can get ideas about bicycling from other group riders. Choosing the perfect bicycle to fit your needs.
As far as picking out a bike, I’m of the firm philosophy that it’s not about the bike, it’s about the rider! My bicycle is an old steel racing bike from that mid ’90s, that I paid $200 used. I can ride as well or better than some guys that have $2000 bicycles. Sure, my steel bike might be 5 lbs heavier and the components aren’t nearly as good, but at my ability level that 5 lbs not going to make a ton of difference. If anything, I should worry about losing 5 lbs off my gut, rather than paying $1000 to lose 5 lbs off my bike. haha
For you, I’d probably recommend buying from a bike shop, though. They can ensure that the bike fits right and that the bike is sound, mechanically. Plus they can stand behind the bike if anything goes wrong, as well as helping you do routine maintenance. As for picking your bike, try to test ride as many different bikes as the shop will allow. That’s the only way you can know if the bike feels right for you or not. People can talk all they want about different brands, styles, etc of bike, but my feet hitting the pedals is the only way to know what bike is right for ME.