If I have $\sum_{ i = 0 }^{f(x) 1, \space\space(\forall \space1 \leq x \leq 4)$ where $ f(x) = 2$, then does this mean that this summation is counted 4 separate times? So for when x = 1, x = 2, x = 3, x = 4?
For example, is this equivalent to $\sum_{ i = 0 }^{f(1)} 1$ AND $\sum_{ i = 0}^{f(2)} 1$,... ?
Say $f(x) = 2x$. Then would this end up being $\sum_{ i = 0}^{2} 1$ AND $\sum_{ i =0}^{4} 1$,...?
Or would it end up being all of these summations summed together into one big summation? $\sum_{ i = 0}^{2} 1$ $+$ $\sum_{ i =0}^{4} 1$ $+ ...$
$\sum_{i=0}^{f(x)} 1$ is a function of $x$ -- vary $x$ and you may vary the value of this expression (depending on the details of $f$). This is perhaps clearly expressed by the definition $$ g(x) = \sum_{i=0}^{f(x)} 1 \text{.} $$
When you make $f(x) = 2$, then $f(x)$ is constant and this expression simplifies to $\sum_{i=0}^2 1$. However, there is nothing about the summation that forces $f$ to be a constant function. When $f(x) = 2x$, we have \begin{align*} g(x) &= \sum_{i=0}^{f(x)} 1 \\ &= \sum_{i=0}^{2x} 1 \text{.} \end{align*} which is clearly an expression whose value depends on $x$. We have made a function -- for each choice of $x$ the expression on the right has a value.
You say that $x$ is restricted to the set $S = \{1,2,3,4\}$. That means $g$ is a function from $S$ to (in this case) some integers. (We can be more specific, but why?) With $f(x) = 2x$, the function is \begin{align*} g(1) &= 1+1+1 = 3 \text{,} \\ g(2) &= 1+1+1+1+1 = 5 \text{,} \\ g(3) &= 1+1+1+1+1+1+1 = 7 \text{, and} \\ g(4) &= 1+1+1+1+1+1+1+1+1 = 9 \text{.} \end{align*} We could graph this function as the points $\{(1,3), (2,5), (3,7), (4,9)\}$. We are capable of ignoring that the value of the function depends on its input and think about all of the outputs simultaneously (the image of the function), but that ignores half of the specification of the function -- the inputs and how they are paired with the outputs. Don't forget the pairing inherent in a function.