While jurisprudential answers exist to the question of who is a Muslim, they only provide a criterion used to settle issues in Islamic law, such as inheritance, without regard to one's true beliefs or allegiances.
No matter how narrowly we define being a Muslim (Shi'ite, 12 Imami, for example), there will still be contradictions. There are liberals, conservatives, socialists, free market proponents, etc.
1. In jurisprudence, what it means to be a Muslim.
2. Being a member of the Muslim community. One can achieve it in two ways: (a) by being accepted by a community of Muslims of which one is considered a member, or (b) by identifying with a specific group. A person's affiliation is determined by the attitudes of others in (a); one's attitudes determine it in (b). In the early years of Islam, affiliation took the form of allegiance to political authority and continued concerning spiritual power by the Sufis. Without the outward form of loyalty, affiliation can be defined as mutual acceptance between a leader and a follower, whether the authority is political leadership, teaching authority (law, doctrine, explanation, etc.), or spiritual authority.
3. Being a follower of Islam's values and doctrines. It can take many forms. Among the various conditions are the holding of Islam's values and doctrines according to (a) the Wahhabis, (b) the Traditionalists, (c) the ulama of Qom, (d) Mulla Sadra, (e) the Mevlevis, (f) the awliya', or (g) one's own understanding of what these are.
4. Observing point 3. In Islam's history, there has been a major controversy about this topic, with Kharajites holding that anyone who commits a major sin is not a Muslim, and Muji'ites holding that the grave sinner is both a Muslim and a believer. Shi'ite theologian Shaikh Mufid believes that grave sinners may be Muslims, but not believers in the full sense, rather "sinful believers" (mu'min fasiq). In this case, however, it was about whether major sins prevented one from becoming a Muslim legally. Zayd may also be a Muslim in the legal sense, but not in a behavioral sense, for example, because he is a hypocrite.