The attributes of the water used in brewing, not just its cleanliness, are very important when making beer. For example, the quality of ales brewed in Burton-on-Trent in England is largely due to the local water. Likewise, the magnificent pilsners that come from the Czech Republic would not be possible without its water source. “Hard” water, which is high in dissolved salts, is regarded as best for brewing ales, while “soft” water, which has fewer salts, is generally best suited to lagers.
However as long as your brewing water is clean and sanitary then you will be able to make perfectly good beer. There are more important things to concentrate on getting right when homebrewing than the chemical analysis of the water you use.
Once you have mastered temperature control, sanitation, the use of hops and grain, mashing, etc, you may wish to look at ways to tweak your water to suit particular styles of beer.
Most homebrewers use water straight from the tap and it results in good beer. If you are using rainwater and it will not be boiled with the wort it is a good idea to treat it with a campden tablet or boil it to kill any bacteria or wild yeast that could ruin the brew.
In mash brewing, the full volume is boiled, so using rainwater is not an issue because any bacteria will be killed during the brewing process.
If you do want to investigate treating your brewing water you need to know the water analysis of your supply.
For town water (i.e. water from the mains) your local water supplier's website may contain water analysis information, or you may need to make contact with the company to request a report. Among a lot of information, it should include data on the amount of various dissolved salts and other compounds such as potassium, calcium, sodium, sulphate and magnesium. From that, you can work out what needs to be added to your brewing water to make it ideal for the style of beer you are making. Rain water will contain very little of anything (apart from bird droppings) so assume there are no dissolved salts in it. If you use bore water or water from some other underground source or direct from a waterway, it is possible to pay for an analysis to be done on a sample.
Mash brewers who have very soft tap water or are using rainwater to brew may add a teaspoon or so of calcium chloride to enhance the malty character of a beer, while calcium sulphate will bring out hop character.
The bottom line is that if your water is hard or soft, it will not cause you to brew a bad beer, either ale or lager. If you are having problems with the quality of your brews, it is highly unlikely that the hardness or softness of your water is the culprit, and you should look elsewhere.
Information on treating water to suit brewing a particular styles of beer will be added soon.