It's not clear if the first entry should be zero or one (the body of the question uses $x_0=1$ but in the code there is a[[1]]=0) and if it's RandomReal or RandomInteger the relevant function to use; here, the first entry in the list is set to zero (see xo below) and RandomReal is used to generate the random numbers.
(* init *)
With[{l = 50, xo = 0},
(* make everything reproducible *)
BlockRandom[
(* localize the generation of random numbers *)
Block[{r = RandomReal[{-1, 1}, l - 1]},
(* perform the actual iteration *)
FoldList[#1 + #2 &, xo, r]
], RandomSeeding -> 123]
]
edit #1
Let $X_l=\{x_t\}_{t=0}^{l-1}$ denote a series of $l$ numbers, namely $X_l=\{x_0,x_1,...,x_{l-1}\}$. Please note that when using zero-based indexing for a list of $l$ numbers, the indexes themselves run from $0$ to $l-1$.
Consider the following example: for $l=3$, the list of numbers is going to be $X_3=\{x_0,x_1,x_2\}$.
Writing something like $x_s = x_{s-1} + c$, where $c$ is a scalar and $s$ is an index, running from $1$ to $l-1$, allows one to impose structure on list $X_l$.
A recursion like this, in the case of our example with $X_3$ above, would imply that, instead of $\{x_0,x_1,x_2\}$, list $X_3$ should-effectively-be transformed into $\{x_0,x_0+c,x_0+2c\}$ (example 1).
A further extension of the recursion model would allow $c$ to be dependent on the recursion step, $s$, too. In that case, the recursion would be written as $x_s = x_{s-1} + c_s$; in which case, the $X_3$ example should be modified to read $\{x_0,x_0+c_1,x_0+c_1+c_2\}$ (example 2).
Now, in the body of the question, function $f$, defines a recursion that is seemingly (that's my interpretation of the question in conjunction with the code provided) similar to the first example above ($x_s = x_{s-1} + c$, where $c$ a scalar); furthermore, it is explicitly stated in the question that $x_0=1$ (the first number in the sequence should be equal to one).
When ones inspects the code segment, however, one can't help but notice that the sequence a=Range[l]; a[[1]]=0; effectively imposes $x_0=0$ (the a[[1]]=0 part), contrary to what was originally stated.
Additionally, calling RandomReal in a[[i]] = a[[i - 1]] + RandomReal[{-1, 1}] will produce a new random real number for every iteration step; this behavior implies that the relevant recursion model is that of example 2 (see above).
This, however, contrasts with what was initially adhered to (see quote "[...] $f(x_n)=x_{n-1}+r$ where r is a random real number between -1 and 1" from the question; here, $r$ is not dependent on the recursion step).
Having said that, if the relevant recursion model for the original question is the one exemplified in example 1, then a straightforward way to generate a list $X_l$ is
xo + Range[0, l-1] RandomReal[{-1, 1}]
On the other hand, if what's relevant for the question, is the recursion model of example 2, then a straightforward way to generate list $X_l$ is
FoldList[#1 + #2 &, xo, RandomReal[{-1, 1}, l - 1]]
edit #2
The use of BlockRandom is intended to assist in producing reproducible results.
For the function definition f[x___] := RandomReal[], evaluating f[] two consecutive times will produce two different random numbers.
On the contrary, evaluating BlockRandom[f[]] two or more consecutive times will always produce the same random number.
The same effect can be gotten with BlockRandom[f[],RandomSeeding->123456789] where RandomSeeding provides the seed for the random number generators (see the documentation for BlockRandom).
The same effect as BlockRandom can be practically achieved by, using instead SeedRandom before the evaluation of f in the example above (although there are caveats, please refer to the documentation).
What this means for this answer is that you can practically have a functioning solution without using BlockRandom if you choose to not use it.
According to the documentation, BlockRandom was introduced in 2007 (v.6.0) and was updated in 2017 (v.11.2)
FoldList/Accumulateand related functions. $\endgroup$x = 0;Table[x = x + RandomReal[{-1, 1}], i], whereiis the length of the list you desire. $\endgroup$Prepend[ RandomReal[{-1, 1}, 50], 1]$\endgroup$NestList[# + RandomReal[{-1, 1}] &, 0, 20]$\endgroup${0}~Join~Accumulate[RandomReal[{-1, 1}, l]]. $\endgroup$