A few things…
Regardless of the deceased or their family’s religious belief, Chinese funerals are very rigid and do NOT object when told to do anything that may seem weird to you.
It seems the tradition is, when bodies are lowered into a coffin, or if a coffin is lowered into the ground (for traditional burials, which seems rare in Taiwan), you will be told to turn around and not look. The belief is if you look somehow the misfortune that led to the person’s death would somehow transfer to you.
If you are the family of the deceased, you will be expected to hold incense or the deceased picture. It depends on your relationship with the deceased. For my grandparents I had to hold the picture because I am the eldest grandson of the eldest son of my grandparents. Things like this mean a lot in a traditional Confucian family. If you are the foreigner you will likely be told to sit in the back, especially if you have little to no relationship with the deceased.
At the end of every funeral, you do not bid farewell or say goodbye. The idea is you do not want to meet them under similar circumstances again (basically at a funeral of someone else).
Do exactly as you are told, follow the funeral director to the letter. They are professionals. Failing to do that can be seen as disrespect, and while younger people may not care as much, the old ones will, and you will lose relationships this way (as people tend to follow their parents without question here).
If you have any questions, ask. The best thing may be that you are not invited at all, because funeral is a big deal here, and messing it up can really hurt you badly. Add in “100 year of humiliation”, “foreigner pick on Chinese people”, and this could turn ugly FAST. If you are invited come well prepared and make sure you’re up to speed on the traditions that family follows (it varies with each family). They will probably cut you some slack if you don’t know but make sure the rules are followed to the letter.