I've just started learning Japanese, and I've been told that the か at the end of a sentence is playing the role of a question mark (at least in formal Japanese). How does the sentence change if the か is removed? Does it just go from "How are you?" to "You are."? Or am I missing something here?
元気 means "fine" and お before 元気 describes politeness (to the listener = "you").
です is "be" and か makes it a question.
You may notice that there is no subject, but it can be inferred to be "you", because it is a question.
Therefore お元気ですか literally means "Are you fine?"
By removing か, it might become "You are fine." but resulting お元気です is not natural, as its subject is no longer clear and the お for politeness doesn't match here.
If you remove お, you get a natural sentence 元気です which means "I'm fine." In this case the subject is still ambiguous but is likely to be inferred as "I"
If you want to omit the か, you also need to omit the です。
I put the question mark to indicate you have to use a rising entonation. If you use only です with a rising entonation, it's not correct.