Given $g(x)$, is there a function $f(x)$ so that $f(x) - f(x-1) = g(x)$? Let $g:\mathbb{R}\to \mathbb{R}$ be a given function. My question is 

Does there exist a function $f\colon X\subseteq\mathbb{R}\to \mathbb{R}, x\mapsto f(x)$ such that $f(x)-f(x-1)=g(x)?$ for all $x\in X$? 

I am able to guess some very simple cases. For example, if $g(x)$ is constant $g(x) =k$, then $f(x)$ is linear $f(x) = kx$ since 
$$f(x)-f(x-1) = kx - k(x-1) = kx -kx + k = k.$$
In general, is there a way to find $f(x)$ without guessing?
 A: Define $f$ any way you like on $[0,1),$ and then extend to all positive numbers inductively using $f(x+1)=f(x)+g(x+1).$ Similar for negative numbers.
So, for an integer $n\ge 0$ and $0\le x<1$ we have
$$f(n+x) = f(x) + \sum_{k=1}^n g(k+x).$$
A: For each function $f\colon\mathbb{R}\to\mathbb{R}$, a $g$ exists because, for all $x$, $f(x)$ and $f(x-1)$ exist and $g(x)=f(x)-f(x-1)$ is a real number.
The mathematical problem where $f$ is given and $g$ is concluded can be decided and solved numerically and symbolically in the language of recurrence equations or in the language of differential equations.
The mathematical problem of your question where $g$ is given and $f$ is concluded can be decided and solved numerically and symbolically in the language of definite summation. The last equation in Martin Reiner's answer is the formula for definite summation.
The known decision and solution theories for definite summation are Gosper's algorithm, the algorithm of Michael Karr and the algorithms of Carsten Schneider.
Look at my answer here at Mathematics StackExchange for some literature references.
