Your outfit is unlikely to be your top priority when you are attending a funeral. You should have a basic funeral outfit to wear, and you can recycle this outfit for every funeral you go to.
Wearing black to a funeral is expected. It may be a cliche, but it is what you are required to do. Sometimes it may be the case that a color is specified on the invitation. For example, if the favorite color of the deceased was yellow, then everyone may be asked to wear yellow. If no instructions are provided, wear black and other dark colors. The exception to the rule is, of course, your shirt. Do not wear a black shirt.
A funeral is not the time to try out a brand new look that just came off the catwalk. Wear something conversative and predictable. Do not worry about injecting some of your own personal style into your funeral outfit, as you are expected to dress in a nondescript way. If you are a pallbearer, you should be even more aware of making sure you are dressed appropriately. Ensure everything is neat and uncreased.
Wear a suit
You should have a well fitting, dark colored (preferably black) suit for the occassion. Wear with a white shirt and a black tie (navy and maroon are acceptable alternatives if you do not own a black tie). It is not the time to play around with wearing unique or colorful ties or bowties. Keep it simple. Your shoes should be black and polished leather.
Do not take off your jacket for an indoor funeral ceremony, although you may remove it if you are outdoors and the weather is warm enough.
Know the traditions
Different religions have different modes of dress for a funeral. For example, as a Muslim funeral you may be required to remove your shoes. It pays to be aware of these traditions ahead of time, so that you are fully prepared for the modifications to your outfit that may be required. You would want not want to be wearing old and greying socks if you are asked to remove your shoes.