What is the function of the ovaries of the worm?
to relase eggs
What pair of organs are similar in structure and function in the male and female reproductive systems?
The ovaries are part of both the reproductive system and the endocrine system. Their reproductive function is the production of eggs (ova), and their endocrine function is the production of sex hormones (primarily estrogen and progesterone, but also testosterone). Ovaries produce estrogen and progesteron, so I guess it's safe to assume that they are part of the endocrine system.