Most Helpful Guy
There aren't really any kind of rules for this. It's VERY open and people will be most accepting, far more than they normally are.
It's a little different, but what I tell people about funerals is if you want to go then go. The funeral is for anyone who wants to give their last respect to the deceased. It can also be to support the family. This is entirely open and up to you.
The only thing I'd say to NOT do is if you think it would cause tension. In that case I'd say it might be better to stay away, or maybe express your thoughts in a card, flowers, or even email. (I think text would not be appropriate) This is really up to you and your own feelings in the matter.
Unless you are very close to him, I think this should be something you want to do rather than feeling some kind of obligation to your ex. Realistically there is nothing you can do to ease his pain. Time is what heals. He may appreciate kind words from you, but it won't help ease his loss.
Unless you think it would cause tension, just follow your heart. This is not a normal social situation. As long as your intentions are right you should be ok.
Also, don't hesitate to call or visit a funeral home to ask questions and get advice. They aren't clergy, but this is their profession. They can advise on every aspect from the social issues and grieving, to whether a certain flower is safe for cats who may nibble on it. It doesn't even have to be the one where the funeral takes place. You can ask at any random one and they should be willing to talk to you. A funeral home is there for the living.
Follow your heart in this.