I would not wear a hat. Also, try to keep the entire outfit black. You don't have to wear a dress to a memorial but if you do, it should be at your knees or longer. Nothing tight. A black maxi dress would be okay too or a black maxi skirt with black blouse. You can wear a black blazer or cardigan if you wish. No bare shoulders. Sheer black pantyhose should always be worn with a dress or skirt to a memorial or funeral. Bare legs would be very tacky. You also need to wear moderate heels. If you opt for pants, they need to be formal black pants that go down to the floor and they should be wide legged or at least flared at the bottoms. No skinny or slim fit pants. Keep makeup and jewelry simple. Hair can be worn anyway you like. Nails should not be long or flashy. No bright reds. French manicure is nice or just a pale pink or no polish.
I'm very sorry for your loss.
It would be better not to wear a hat. The black dress is definitely perfect for this sort of occasion, just make sure it isn't short at all, or that could be seen as disrespectful
I think the cardigan is fine but wear crime coloured, white actually doesn't look great with black. I think the hat is kind of disrespectful. I wouldn't wear it.