The preposition "of" is not optional in the phrase "I remember the rain on the roof of my house." In this context, "of" is required because it indicates possession or belonging—"the roof of my house" means the roof that belongs to the house.
As for "remember of," this phrase is generally not correct in English. The verb "remember" does not typically use "of" as a preposition after it. Instead, you might see constructions like "remind of" (e.g., "That reminds me of something"), where "of" introduces the thing being recalled due to an external cue.
If you meant "I remember the rain 'on' the roof," you are correctly using the preposition "on" to indicate location, and "of" to show possession of the roof by the house.