I'd suggest renting a car from Enterprise in Glenview: 2300 Waukegan Rd and returning it at the O'Hare Enterprise. Taxi's tend to be more expensive and they're not always the best drivers.
You might consider taking an Amtrak all the way to the Milwaukee Airport Amtrak stop (MKA) and renting a car from there. Check the rates but it might be easier/less expensive. If you go this route, consider getting off Amtrak on the way back to Chicago at Glenview before taking an Uber/American Taxi to ORD. Taking the Amtrak to Union Station only to have to sit on the Blue Line to ORD isn't great. Or just take the Blue Line to ORD, rent from ORD, and return to the same place when you fly home.
No matter where you get the car from, make sure you determine whether a one-way fee might apply if you don't return it to the same place. To me it just seems like a lot of work to take Metra/Amtrak to Glenview, then get to the car rental place, then Uber/taxi to ORD but it's obviously your trip.
You can always check Uber rates here:
Cab fares here (though use American Taxi if you go that route):
Good luck... safe travels.