Check with your local municipality to ascertain the legality of attaching your sump pump discharge to the city sewer system. In many areas where flooding is an issue, there are codes restricting this behavior. The city sewer system keeps track of your sewer usage by monitoring your water usage, and thus they cannot charge you for water directly dumped into the sewer line but not emanating from the city water system. Disregarding these codes can lead to hefty fines, so double-check before beginning.
Washing machine drains, like most drains, typically have what is known as a trap. A trap is a small elbow in the pipe that constantly contains water and works to keep sewer gas from backing up into your home. You do not want to remove this trap when adding your sump pump discharge pipe to the drain, as the gas can be harmful or, at least, quite smelly. Install your sump pump discharge hose or pipe away from the trap to maintain the integrity of the drain.
The easiest way to install both the washing machine and the sump pump discharge into the same drain is simply to fashion a splitter out of PVC. You will need two small lengths of PVC pipe that will fit into the existing washing machine drain, and a Y-coupler. Place the Y-coupler into the washing machine drain, securing it to the metal drain using a rubber coupler. Then feed your washing machine drain into one end of the Y, and your sump pump discharge in to the other.
This is an easy quick fix for a flooding basement that needs to begin to drain right away, but is not a good long-term installation. The issue lies in the two drains feeding into the same pipe. If your washing machine is running at the same time as your sump pump, you risk increasing the pressure inside the small drain and causing sump pump discharge water to flow back into the washing machine and damage your clothes.