First, understand that what you wear to the funeral is much less important than actually going to the funeral or gathering. Don't underestimate the value of your presence.
Your kind words, shared stories, or even just a hug will mean a great deal to friends and family when there has been a death. Don't let not having a pair of dress shoes keep you from offering your support.
That being said, what you wear depends on several different factors. The first thing to consider is who died.
If your 80-year-old grandfather passed, the funeral is likely to be more traditional. His older friends will attend, so you will want to be more conservative.
A pair of slacks and a collared shirt for men and boys will do nicely. If you own a sport coat, by all means wear it. A tie with or without the jacket would be a nice, but not a required, addition.
For the ladies and girls, dress slacks and a nice sweater or blouse will serve the purpose. A dress or skirt would also be lovely. Do pay attention to necklines and length of the skirt.
When the funeral is for a younger person or will not be faith based, it may be more informal.
A celebration of life is typically more relaxed and may even have a theme that the family will ask attendees to support. So if you're asked to wear golf attire to the funeral of an avid golfer, don't be surprised.
Like the dress code for most events today, what we wear to a funeral has relaxed. Black is no longer required, but neat, clean, and subdued are always in good taste.
A funeral is not a place to stand out or be the center of attention. As you survey your wardrobe, think in terms of what you would wear to an important job interview or something you would want to wear to apply in person for a bank loan.