The fact that you've asked the question signals that you're not likely to offend anyone by showing a lack of care or disrespect when choosing your attire for the event.
What is considered proper to wear to a funeral or memorial service differs according to local customs and geographic region. But a few general guidelines can help steer you.
Mercifully, the old dreary dictate about wearing only black no longer applies -- although, when in doubt, it's still generally a safe bet to choose either black or more muted colors, such as earth tones. Be guided by the general rule that you're attending the service to honor the person who died and to support close survivors, not to attract attention to yourself.
If you'll be attending a funeral rather than a memorial service, or you're related to the deceased or you have a role in the service, such as being a pallbearer or reciting a reading or prayer, choose somewhat conservative clothing.
You're generally safe to dress less formally when attending a memorial service; just make sure your clothes are clean, pressed, and presentable.
If the service is being held close to where you live, you probably already have a good idea of what would be considered acceptable -- or you're acquainted with someone in the know whom you can ask for advice: the funeral director handling the arrangements, the religious leader who will be officiating, a relative or close friend of the deceased.
But if the service is being held out of town, you may need to be a bit more attuned to local customs, or do a bit of sleuthing to find them out. To locate people who can fill you in on local clothing etiquette, such as the funeral director or religious leader who is involved, check the obituary or death notice.
When uncertain, dress up: Business attire such as a dress or suit will pass muster most everywhere. But these days, dress slacks are also fine for women, and men needn't wear ties if they have a suitable substitute, such as a silk shirt or mock tee or turtleneck.
And all rules may fly out the window if the service is personalized in keeping with the specific tastes or quirkiness of the person who has died. For example, if the deceased was a clothes designer, feel free to honor that by wearing one of his or her creations. And some survivors choose to create a festive aura by specifying, for example, that those who attend wear the deceased's favorite color or wear specially customized memorial T-shirts. This type of break with tradition will usually be clear from the service's announcement or invitation; if you're uncertain, ask for some wardrobe advice from a relative or friend involved in planning the event.