Is $\ a + b$ defined by $\ (a + b)(x) = a(x) + b(x) $ a step function where $\ a $ and $\ b $ are step functions Note: x ∈ X$ is a step function where $\ X ⊂ R^n$ is a finite union of boxes and $\ a, b : X → [0,∞)$ are step functions. But I have only just started looking at step functions and I am struggling to come to terms with how this is possible. 
So I know that a function a is a step function if a takes only finitely many values and if there exists a finite union of boxes 
$\ a^{-1} ([R_i, ∞)) = $ {$\ x ∈ X | a(x)∈[R_i, ∞) $}
But I don't know how I proceed knowing this. In an example I have done, I took values from a graph and plugged them into $\ a^{-1} (R_i, ∞)) $ for some $\ R_1 $ and $\ R_2 $ to show they are both boxes... but I am unsure how we use this to show the product is a step function. Apologies if this is a juvenile question, but like I say, I am new to this topic so I am still trying to understand it. 
 A: Welcome to math.SE.
You call $f$ a step function if it takes only finitely many values $0 \leq R_1 < \dots < R_n$, and for each value $R_i$ you can write the preimage $f^{-1}\!\left[R_i, \infty\right)$ as a finite union $B_1 \cup \dots \cup B_{m(i)}$ of boxes. You wish to prove that the pointwise sum of two step functions is itself a step function.
Let $h$ denote the function $x \mapsto f(x) + g(x)$. We have to prove two things:


*

*The function $h$ takes only finitely many values.

*For each value $S_i$ taken by $h$, we can write the preimage $h^{-1}\!\left[S_i, \infty\right)$ as a finite union of boxes.


For the first condition, assume that $f$ takes the values $0 \leq R_1 < \dots < R_n$, while $g$ takes the values $0 \leq Q_1 < \dots < Q_m$. Since each value taken by $h$ has the form $R_i + Q_j$ for some $i,j$, the pointwise sum can take at most $nm$, so finitely many, values.
For the second condition: since we already know that $h$ takes finitely many values, say $0 \leq S_1 < \dots < S_k$, we can write $h^{-1}\!\left[S_i, \infty\right)$ as a finite union $\bigcup_{j \geq i} h^{-1}\!\{S_j\}$. So it's enough to show that we can write each preimage $h^{-1}\!\{S_i\}$ itself as a finite union of boxes.
Consider $h^{-1}\!\{S_i\}$. The set $\mathfrak{M}_i = \{(R_x,Q_y) | R_x + Q_y = S_i\}$ is finite, and we have $$\displaystyle h^{-1}\!\{S_i\} = \bigcup_{(x,y) \in \mathfrak{M}_i} f^{-1}\{R_x\} \cap g^{-1}\{Q_y\}$$
so again it's sufficient to prove that each $f^{-1}\{R_x\} \cap g^{-1}\{Q_y\}$ is a finite union of boxes.
Since the intersection of two boxes is always a box, the intersection of finite unions of boxes is always a finite union of boxes. This follows by applying distributivity of intersection over union, e.g. $(B_1 \cup B_2) \cap B$, an intersection of finite unions of boxes, could be rewritten as $(B_1 \cap B) \cup (B_2 \cap B)$: since $B_1 \cap B$ and $B_2 \cap B$ are both boxes, this amounts to writing $(B_1 \cup B_2) \cap B$ as a finite union of boxes.
But we know that both $f^{-1}\{R_x\}$ and $g^{-1}\{Q_y\}$ can be written as finite unions of boxes, so their intersection can be written as a finite union of boxes as well, which proves our claim.
