Hydrogen Fuel Cell and Battery For hydrogen fuel cell to produce electricity, hydrogen  will need to be supplied to the anode. To split oxygen and hydrogen from water and obtain hydrogen, we need to use electrolysis. To use electrolysis, we need to use a battery.

My question is, why do we bother splitting up hydrogen and oxygen and then feed it into the fuel cell instead of just using battery to generate electricity? Or is it not practical to obtain hydrogen and oxygen from electrolysis and use it to generate electricity from fuel cell? Thank you
If you have a fuel cell, only hydrogen needs to be carried with the car; the air provides all the oxygen you need. Hydrogen is an extremely light fuel, but there are some issues with current means to contain it (e.g. heavy high pressure container, or massive hydride tanks).

According to Iceland is Bullish on Hydrogen, they've started to use their plentiful geothermal and hydroelectric power to electrolyze water, using the hydrogen to power cars and the oxygen byproduct for other uses.