I agree that this question is rather elementary for this site but since Easter is around the corner... Assume the $X_i$'s are independent. Suppose that $X_i$ takes the values $a_i$ and $ b_i $, with probabilities $p_i(a_i)$ and respectively $p_i(b_i)$, where $p_i(a_i)+p_1(b_i)=1$. Without loss of generality we can assume $a_i< b_i$. The vector valued r.v. $\vec{X}=(X_1,\dotsc, X_n)$ is distributed on the set $V$ of vertices of the parallelepiped $$ P=\prod_{i=1}^n [a_i,b_i]. $$ A vertex $\vec{v}$ of this parallelepiped has coordinates $$ \vec{v}=(v_1,\dotsc, v_n),\;\;v_i\in\lbrace a_i,b_i\rbrace. $$ The probability that $\vec{X}=\vec{v}$ is $$p(\vec{v})=\prod_{i=1}^n p_i(v_i). $$ In other words, the probability distribution of $\vec{X}$ the measure $$\vec{\mu}=\sum_{\vec{v}\in V} p(\vec{v})\delta_{\vec{v}}, $$ where $\delta_{\vec{v}}$ denotes the Dirac measure on $\mathbb{R}^n$ concentrated at $\vec{v}$. The distribution $\mu$ of $f(\vec{X})$ is a sum of Dirac measures $$ \mu=f_*(\vec{\mu})=\sum_{t\in \mathbb{R}} w_t \delta_t, $$ where $$w_t =\sum_{f(\vec{v})=t} p(\vec{v}). $$ In the end the problems reduces to identifying which of the vertices of $V$ lies on a given level set of $f$ which may not be easy for a complicated $f$. If $a_1=\cdots =a_n=a$, $b_1=\cdots =b_n=b$, $p_1(a)=\cdots =p_n(a)=p$ and $p_1(b)=\cdots = p_n(b)=q=1-p$ the above formula simplifies somewhat.