There are a few answers to this.
1. There has been people reported dead mysteriously. This immediately sends some signals.
2. Bella also is a very intuitive gal. And for some reason she has a special connection with Edward. Also, she has been observing him. One can pick up a lot of things by observing!
3. The very fact that she does some research is the clincher. She has a hunch and things fall into line.
4. Its a movie; it does not need to make sense.
In the movie version, when Bella and Edward are returning home from Port Angeles, they notice the emergency vehicles and lights at the sheriff's office. When they stop, they discover that one of the local men has been found murdered. As she is walking out of the sheriff's office, the dead man's body is being placed into an ambulance, and Bella notices his uncovered foot. The skin color is very pale, which reminds her of Edward's coloring. She's a smart girl, and all the odd things about Edward start to come together in her mind. At home, she does some Internet searching, especially of the legend Jacob had told her about.
The next morning, she leads Edward into the woods and confronts him about what she knows: his skin is pale white and cold like that of a dead person; he never eats; he doesn't go out into sunlight. He must be a vampire!
So, you see, it's really not all that random.
The dead body made Bella think about the similar characteristics that relate to Edward and the story. Instead of a dead body it was more of a relation to the undead.
The dead body is meant to symbolize the undead, not living, or soulless. The dead body makes her think of the story-- about why the Quileute's do not like the Cullen's, the cold ones, etc. -- that Jacob was telling Bella about. The dead body also made her think of the similarities that Edward has with the story and a corpse.