私は花子です。
this sentence's focus is on 花子
If someone asked what's your name, then the focus would be on the name, so you use は.
私が花子です。
this sentence's focus is on 私
and if someone asked who is 花子, then the focus would be on the 私, so you use が
誰が花子ですか?
花子は誰ですか?
The focus is on 誰
× 花子が誰ですか?
× 誰は花子ですか?
These two are wrong because the focus is on 誰
○ 日本はどこですか
○ どこが日本ですか
× どこは日本ですか
× 日本がどこですか