You can't. You'll need to go to the Stealership, with your vehicle registration and ID, and have them order you one from Germany. Takes about a week and you then give them around $180.
In the trunk.
the battery is in the trunk under the trunk floor mat
Driver's side kickpanel.
In the trunk, below the trunk floor. The trunk floor is a panel that lifts out to access the battery.
Pray its summer and the windows are open a crack. Then its simple. I locked my keys in the trunk. With ingenuity, you can get inside. I used a regular coat hanger to snag the door handle, pull it once unlocks the door. (Trying to press the center armrest unlock door button only serves to relock the doors again) Once inside, I reached in the trunk from the passenger compartment, and with luck, found my keys. If the windows are closed, you best call a locksmith to avoid damaging the window or the price to get the window fixed will quickly exceed that for a locksmith.
The 2012 BMW Z4 has 16 valves.
The 2005 BMW Z4 has 24 valves.
The 2009 BMW Z4 has 24 valves.
The 2008 BMW Z4 has 24 valves.
The 2011 BMW Z4 has 24 valves.
The 2010 BMW Z4 has 24 valves.
The 2014 BMW Z4 has 16 valves.