Oof. This is a tricky one.
Thing one: grief is for the grieving to decide what to do with. If you feel like you need to attend the funeral for your own process, do that. Obviously there may be some questions or awkwardness, but you likely won’t be the central focus even if you raise some eyebrows. People at funerals are (usually) pretty in their own heads. You can always try to minimize interactions and duck out as soon as the service has ended.
If you don’t feel like you need to attend for yourself, but don’t want to seem like you don’t care or notice the loss of your friend, maybe consider sending a note or letter to the family. Something to reflect on good memories you have together and expressing your feelings. It will get you out of an awkward situation without the event going unrecognized. I imagine the family would also appreciate knowing that their loved on had an impact on you.
Either way, a rough position to be in. Best of luck, and my sympathies for the loss of your friend.