I'll say it's a personal choice that's up to you?
I'm not a divorcee but I'm a single mum - unfortunately, my son's father and grandparents (on his father's side) don't even know about his existence and we didn't keep in contact after he found out I was pregnant, so I couldn't establish a relationship between my child and that side of the family.
As much as possible, I'd try to keep the relationship good between you, your husband and your child - even after the divorce. As for the part about agreeing to go to his parents' funeral, I'd say that it's ultimately up to you - but I personally would agree because it's your child's grandparents after all - no matter what happened in your marriage, I don't think you should let it affect the relationship between your child and his/her grandparents. Just because a marriage didn't work out doesn't mean the relationship between families can't!
You don't have to force yourself to stay with your husband in an unhappy marriage, but you can put in the effort to maintain a good relationship/friendship with him after - and with grandparents too :)