This is an exercise, and I want to be sure if the following statement is true or not:
Let $f : \mathbb{F}_2^{m-1} \longrightarrow \mathbb{F}_2$ be a Boolean function. We can define another Boolean function $g:\mathbb{F}_2^m \longrightarrow \mathbb{F}_2$ by $g(x_1,\dots,x_m) = x_m + f(x_1,\dots,x_{m-1})$. Then $g$ is balanced. In other words, $|g^{-1}(0)| = |g^{-1}(1)|$.
My proof.
For any $(a_1,\dots,a_{m-1}) \in \mathbb{F}_2^{m-1}$, we have $f(a_1,\dots,a_{m-1},0) \neq f(a_1,\dots,a_{m-1},1)$. Therefore, we can define an map $\phi: g^{-1}(0) \longrightarrow g^{-1}(1)$ by $(a_1,\dots,a_{m-1},a_m) \longmapsto (a_1,\dots,a_{m-1},1 - a_m)$. Then it is clear that $\phi$ is bijective. Therefore, $ |g^{-1}(0)| = |g^{-1}(1)|$ i.e., $g$ is balanced.
Is my thought correct? Thank you very much!
In your first step, $f$ can only take $m-1$ arguments; writing $$f(a_1,\dots,a_{m-1},0) \neq f(a_1,\dots,a_{m-1},1)$$ is not correct. replace this by $$g(a_1,\dots,a_{m-1}, 0) = f(a_1,\dots,a_{m-1}) + 0 \neq f(a_1,\dots,a_{m-1}) + 1 = g(a_1,\dots,a_{m-1}, 1)$$ (otherwise, the proof is valid, although I'd rather write $g^{-1}(\{b\})$ than $g^{-1}(b)$ when considering the preimage).