The short answer is, you can deduct your rental car fees but *not* your mileage when you use a rental car to drive for rideshare or delivery.
The standard mileage deduction is intended for use on cars that you own or lease, not on cars that you rent, since the mileage deduction is inclusive of expenses that you don't incur when renting a car (such as maintenance and car payments).
That being said, you can use the actual expense method--which means that you can deduct the cost gas.
You would also only deduct the portion of the rental fees that is attributable to your business (for example, if you used the car for business 90% of the time, you would deduct 90% of the rental fees).
Driving the car for any personal errands would be considered non-business use!