"We are going to replace carpeting this fall," commented my friend, "and it's been 20 years since our last purchase. What do we need to be thinking about?"

Most people replace carpets every six to 10 years, according to industry figures. However long it is expected to last, a carpet is a long-term purchase. A mistake can't be hidden in the closet, or soon given to the thrift shop. So it is important that the decision be a right one.

Those shopping this year will find that carpeting prices have not advanced drastically. They will find they can buy good styling, color-selection and quality for about $10 per square yard, and very good quality for $15 to $20 per square yard. A few top qualities, sometimes styled by name designers, sell in the $30 to $35 range. And, at the lower end, some still retail for $6 to $8 a yard.

Carpetmakers, of course, have been hit by inflation in costs of materials, labor, fuel, etc. But, fortunately for the consumer, new technology and stiff competition have held prices to reasonable levels.

The real surprise will come in the costs of wall-to-wall carpet installation, and padding, which in some cities now are running from $5 to $7 per square yard in addition to the base price.

Included in carpet price or not, installation charges have risen steeply. Room-size rugs, which are easily movable and turnable, represent a cheaper option, particularly to people who move frequently.

Alfred S. Gussin, who heads the firm that makes both Trend and Roxbury carpets, gives carpet-shoppers some advice:

1) Assess the way you live, the function of the area to be carpeted, and the area in which you live.

2) Take color sanpshots of the room, or rooms, to be carpeted. If possible, assemble swatches of the fabrics and wall coverings now in the room, or those that will be used in redecorating. Study magazine ads and room settings and pull together an assortment of clippings of ideas, colors, and textures that you admire. Take all these items with you to the store or carpet shop to help you make your selection.

3) Find a good dealer. Compare both prices and services. Check with friends to find out where they purchased their carpeting. Ask if they have been satisfied.

4) Expect the retailer to tell you how the various fibers perform, whether backing or padding is needed, and in which rooms you need carpets with a soil-resistant finish. Check carefully the label on the back of the dealer's sample to see what it says about shampoo safety, flammability, light and color fastness, wear, fiber content and care.

Gussin recommends asking yourself such questions as "Is this room one where children will be spending a great deal of time? Will the room be used for eating and casual entertaining? Are there household pets to consider? Is the traffic through the room heavy or light? Is the soil likely to be tracked into the house the oily dirt of urban streets or the dust, clay, or mud of rural settings?

"What are the room's exact dimensions, and are the furnishings heavy or light in scale?"

Gussin says price should not be a prime determinant. If a carpet is exactly right in color and texture and pattern and is $5 more a yard than one which is less desirable, he advises buyers to pay the extra and get the satisfaction over the next 10 years of having made the right choice.

Differences in carpet prices are based on density of yarns, kinds and quality of yarns, complexity of tufting, and dyeing processes as well as the finishes used.

What goes into carpets these days? Nylon accounted for 75 percent of the total face fibers used by the carpet industry in 1977. Acrylics and polyesters accounted for about 22 percent of production and wool for 3 percent, or less.

"We aren't trying to find new miracle fibers anymore," says Robert Dale, head of styling and design at Karastan. "But we do like the new refinements of the old fibers such as Du Pont's Antron III and Allied Chemical's Anso X and Monsanto's Ultron, all of which are engineered to conceal soiling and to handle statis electricity."

Carpets made of these highly developed "third generation" fibers cost a dollar or so more per yard, but manufacturers claim they hold their appearance longer and are "virtually complaint proof."

Soil-retardant finishes now are being applied to many non-third-generation fibers. Karastan, for instance, now is giving a soil-resistant finish to about 98 percent of its lines, and other companies are adding this feature to many of their carpets.

As for new colors, the earth tones remain popular, and browns, rusts, burnt oranges, beiges, terra cottas, natural wool colors, and "nature" tones such as sand, stone, straw, wheat, rice, and ivory are expected to continue. Blues now are standard, and a bright navy blue has been added this year.

New jewel colors, more serene than brilliant, include ruby red, amethyst lavender, deep emerald green, jade green, and pale yellow topaz. Teal blue-green is new. Old rose, or antique rose, is rising quickly in some lines. Pastels such as peach and apricot remain strong. Taupes and grays are very strong in some lines. And carpet industry spokesmen talk of a new "weathered look" which means a silvering of grays, and a graying of beiges and other subtle colors.

As for texture, a velvety suede-link look is taking off. And tone-on-tone or "crushed velvet" looks are gaining. High-sheen finishes are still most popular.

New printing and dyeing techniques mean that pattern and multicolors no longer have to be woven in. They can be applied by machine to plain, tufted carpeting. Current choices and future potential are enormous.

Patterns generally run to abstracts and to simple geometrics. Checks and basket weaves are practical favorites. There are a few good florals on the market today.

Heavy-duty carpets developed for institutional use now are widely available for households and are especially good for high-traffic areas such an entrance halls, children's playrooms, at-home offices and kitchens.

One last warning: Awareness of needs and informed questioning are a shopper's best friend. Don't buy until there are no question marks left. CAPTION: Picture, no caption, Christian Science Monitor