attending a funeral of my bf’s side?

do i attend the funeral of my bf’s great grandad? i knew him. not very well but we did speak at family get together etc… do i get an invite or can i just attend? i’ve never been to a funeral before so unsure on the correct etiquette 🙈🙈

thanks!