Here is what male flowers look like before they open:
And here is what the male flowers look like after they have opened:
Here is a female before it opens:
And after it has opened:
So how can I tell the difference before they open? Look at the following two pictures. My finger is pointing to the difference.
The difference is that in the second picture I'm pointing to the rather large ovary of the female, which is absent in the male flower above it. In the male flower, the stem is adjacent to the sepals of the unopened flower.
Armed with this knowledge, I can save seed from squash. I can either tape the female flower closed the night before it opens or put a bag over it to isolate it. The next day I can access my flower and do a hand pollination with a recently opened male flower of the same type. I will do this a few times for each female flower. After every hand pollination, I immediately re-tape or re-bag the flower so bees can't get in. That way I know I can save seed and it will be the same squash the next year.