In technical terms, goldfish don't actually get pregnant as they are not live-bearers, instead, they lay eggs. Signs of impending egg laying include food refusal after previously having a healthy appetite, less activity as the weight of the eggs slows her down, brighter than normal coloring and nesting behavior. Visual signs of nesting behavior include staying close to (or hiding within) vegetation or other places of shelter in the tank.
The most important step to finding out if a goldfish is ready to lay eggs, is to first determine that she is in fact a female. Females generally have fuller bodies with plumper bellies and shorter, rounder pectoral fins. By comparing the goldfish to pictures of other fish, the owner can usually figure out the gender. Keep in mind though, that just because a goldfish is starting to look a bit fatter, it does not necessarily mean that she is getting ready to lay eggs. Most goldfish breeding occurs during the summer months, when the temperatures are warmer.
Female goldfish can still lay eggs even without the presence of a male, however after the eggs are released into the water, a male fish is needed to fertilize them. Without a male fish, the eggs will not hatch. Knowing the signs of a pregnant goldfish helps to ensure that a successful birth occurs.