Consider a function $f(x)$ with a period of 2L defined within the range $(L_1, L_2)$.
Will the Fourier series remain the same, regardless of the range in which I define the function $f(x)$?
For example, I can define $f(x)$ in the range $(0, 2L)$, $(\frac{L}{2}, \frac{3L}{2})$, or $(-L, L)$, but the Fourier series remains unchanged.
In the image you can see I have a function which is half sin wave. It's period is 2L. I can define this function for any range but period remains 2L, than the Fourier series remains same for all of these ranges?

Yes, the Fourier series representation of a periodic function remains the same regardless of the range in which you define the function, as long as the period remains the same.
Remeber, the Fourier series of the function $f(x)$ in sine-cosine form can be computed as \begin{equation*} f(x) = a_0 + \sum_{k=1}^K a_k \cos \left(k\omega_0 x\right) + b_n \sin \left(k\omega_0 x\right), \end{equation*} where $\omega_0 = \frac{2\pi}{P}$ with $P$ being the period of the signal, in your case $P = 2L$. The coefficients $a_0$, $a_k$ and $b_k$ can be obtained by solving the following integration problem:
\begin{equation*} a_0 = \frac{1}{P} \int_{P} f(x)\,\mathrm{d}x \end{equation*} \begin{equation*} a_k = \frac{2}{P} \int_{P} f(x) \cos(k\omega_0 x)\,\mathrm{d}x \end{equation*} \begin{equation*} b_k = \frac{2}{P} \int_{P} f(x) \sin \left(k \omega_0 x\right)\,\mathrm{d}x \end{equation*}
If a function $f(x)$ has a period of $P = 2L$, it means that $f(x) = f(x + 2L)$ for all $x$ within the domain of the function. When you compute the Fourier series of $f(x)$, you're decomposing it into a sum of sinusoidal functions (sines and cosines), each with its own frequency. The frequencies of these sinusoidal functions are determined by the period $P$ of the function, and not by the specific range you choose.
So, regardless of the range $(L_1, L_2)$ within which you define $f(x)$, the Fourier series will represent the function $f(x)$ with the same frequencies, as long as the period $P$ remains the same. However, the coefficients of the Fourier series may vary depending on the function's values within the chosen range, but the frequencies and the general form of the series will remain consistent.