Yes, you should go. If the family allowed the funeral notice to be posted on Facebook, then you are invited.(They did allow it, because if they objected, it would have been removed.) If you want to go because the deceased was your friend, then your presence will not ruin anything for them. When my father died, one of the things that comforted me was seeing plenty of people attending his funeral. I don't remember everybody who was there, but I do remember how large the crowd was. I wanted the crowd to be big, because that made me feel that his death mattered to others.
Go into the funeral home by the front entrance, about 10 or 15 minutes before the announced start time. Look for a guest book, and if you see one, do sign your first and last name. Other than that, it is okay to go straight to a seat and sit down without conversation unless someone approaches you to introduce themselves. Anywhere except the front few rows is acceptable. Don't sit there, that is only for family.
You should have a one sentence introduction/explanation ready that tells people how you and your friend knew each other. Example: "Hi, my name is John. Jeremy and I were classmates at UTA." If you knew your friend for more than one reason, say them both or choose the one that you know is the reason you knew and liked him as well as you did. Examples: "Hi my name is John. Jeremy and I went to high school together, and later we worked together." "Hi my name is John. Jeremy and I worked together at Target."
During the funeral, it is best to be quiet. Before or after the funeral, if anyone approaches you or there is a time when you are standing near others and they turn to you as if you could be included in the conversation, that's when you introduce yourself and explain your connection to your friend. If the person you are speaking to is in any way related to the person who died, then also add "I'm sorry for your loss" at the beginning or end of your statement. It can replace "hello" or "hi" at the beginning. "I'm sorry for your loss. My name is John. Jeremy and I worked together at Target."
That is probably all you will need to say, though you could need to say it in more than one encounter. If there is a situation that makes you want to say more, then you could tell about a good memory you have of your friend.
Dress nicely, as if for a job interview. Pants are better than jeans. A shirt with a collar is better than a tee. Nuetral or dark colors is better than bright prints. (Or if you are a guy, a white shirt is good.) Dressier clothes are seen as more respectful, and being respectful and polite is the goal of the day. Stay off your phone the entire time you are in the funeral home or at the grave. If you feel the need to peek at your phone to give yourself relief from social anxiety, do it in a bathroom stall where you won't be seen. (Don't do this during the actual memorial service, but it could be acceptable during the part after when people are moving about freely and visiting. Keep it brief, because other people might actually need a turn in the bathroom.)
There might not be a burial that day. (Maybe the deceased is to be cremated and something else done with the ashes, or maybe the burial will be/ already was in another city, and this is a memorial service only.) But if there is one, the funeral director will announce it, and the crowd of people will follow each other from the memorial service to the grave site. Turn on your car headlights while driving in the funeral procession.
Don't scare yourself out of going. Showing up is the right thing to do. You can do it, and the family will be glad that another friend came, even if later they don't remember who you are exactly.