Suppose we had a function defined over the complex numbers:
$ f(x)= \begin{cases} 1&\text{if } x\in\mathbb{R}\\ 0&\text{if } x\not\in\mathbb{R} \end{cases} $
And we are asked to prove that $f(x)=1$ iff $x$ is real.
Obviously, if $x$ is real, then $f(x)=1$ because that is given in the function's definition. Is it enough to use the following to justify the converse and thus complete the iff statement?
Because a complex number is either real or non-real, the function will produce some output for all complex numbers. For all real numbers, the function produces an output of $1$; and for all non-real numbers, the function produces an output of $0$. The function will only produce an output of $1$ if $x$ is real; otherwise, it would produce an output of $0$. Thus, if $f(x)=1,$ then $x$ is real.
I think that is enough to justify the iff statement, but it feels too wordy, and I don't have much experience writing proofs like this. Is what I wrote sufficient to complete the proof, and is there a good way to make it less wordy?