First, to make everybody's life easier, since $e^{2πi} = 1$, then adopt the convention that
$$1^x ≡ e^{2πix} = \cos 2πx + i \sin 2πx,$$
even for non-integer $x$. (Please, everybody do this everywhere. I don't want to keep seeing books and papers in Quantum Theory and Digital Signal Processing filled with $π$'s and $2π$'s! It's like walking in Antarctica under the sun: you end up going $π$-blind. And make $h = 1$, instead of $ħ = 1$, while you're at it. SI uses $h$ as a unit, not $ħ$.)
Then, the continuous Fourier transform and its inverse can be written as:
$$\hat{f}(ν) = \int_{t∈Q} f(t) 1^{-νt} dt\quad (ν ∈ P),\quad f(t) = \int_{ν∈P} \hat{f}(ν) 1^{+νt} dν\quad (t ∈ Q),\\
P = ℝ,\quad Q = ℝ.$$
The archetypal use-case is for continuous spectra for continuous signals or time series, where $t$ is the time and $ν$ is the cycle frequency. (So, I switched your $x$ out for $t$.)
So, the semi-discrete version with continuous time is:
$$\hat{f}(ν) = \int_{t∈Q} f(t) 1^{-νt} dt\quad (ν ∈ P),\quad f(t) = \sum_{ν∈P} \hat{f}(ν) 1^{+νt} Δν\quad (t ∈ Q),\\
P = \{ν_0 + nΔν: n ∈ ℤ\},\quad Q = \left[t_0 - \frac1{2Δν}, t_0 + \frac1{2Δν}\right).$$
Next, the semi-discrete version with continuous frequency - suited for streaming digital signals - is:
$$\hat{f}(ν) = \sum_{t∈Q} f(t) 1^{-νt} Δt\quad (ν ∈ P),\quad f(t) = \int_{ν∈P} \hat{f}(ν) 1^{+νt} dν\quad (t ∈ Q),\\
P = \left[ν_0 - \frac1{2Δt}, ν_0 + \frac1{2Δt}\right),\quad Q = \{t_0 + kΔt: k ∈ ℤ\}.$$
Finally, the fully-discrete version - suited for batched digital signals - has a quantization condition:
$$ΔνΔt = \frac1N,\quad N ∈ \{1,2,3,⋯\},$$
and takes the form:
$$\hat{f}(ν) = \sum_{t∈Q} f(t) 1^{-νt} Δt\quad (ν ∈ P),\quad f(t) = \sum_{ν∈P} \hat{f}(ν) 1^{+νt} Δν\quad (t ∈ Q),\\
P = \{ν_0 + nΔν: n ∈ N\},\quad Q = \{t_0 + kΔt: k ∈ N\},$$
using the definition $N = \{0,1,⋯,N-1\}$.
The cases, above, where the functions have compact domains, the opposite functions and can be extended in both directions to quasi-periodic functions:
$$
P = \{ν_0 + nΔν: n ∈ N\} → f\left(t + \frac1{Δν}\right) = 1^{+ν_0/Δν} f(t),\\
Q = \{t_0 + kΔt: k ∈ N\} → \hat{f}\left(ν + \frac1{Δt}\right) = 1^{-t_0/Δt} \hat{f}(ν).
$$
The compact intervals are only half-open and half-closed, since the upper end-point is a one-period wrap-around from the lower end-point and is already accounted for by the quasi-periodicity condition. (Also, for integrals, in measure theory, they actually use half-open and half-closed intervals so that blocks fit together like bricks in an Inca wall.)
Your case fits into the second slot, semi-discrete with continuous time, with $t_0 = 0$, $ν_0 = 0$ and $Δν = 1/(2L)$. Then your coefficients are included in the following:
$$
A_n = Δν (\hat{f}(+nΔν) + \hat{f}(-nΔν))\quad (n > 0),\quad A_0 = Δν \hat{f}(0),\\
B_n = i Δν (\hat{f}(+nΔν) - \hat{f}(-nΔν))\quad (n > 0),\quad B_0 = 0.
$$
This works out to
$$
A_n
= Δν \int^{+1/(2Δν)}_{-1/(2Δν)} f(t) \left(1^{-nΔνt} + 1^{+nΔνt}\right) dt
= 2Δν \int^{+1/(2Δν)}_{-1/(2Δν)} f(t) \cos (2πnΔνt) dt,\\
B_n
= i Δν \int^{+1/(2Δν)}_{-1/(2Δν)} f(t) \left(1^{-nΔνt} - 1^{+nΔνt}\right) dt
= 2Δν \int^{+1/(2Δν)}_{-1/(2Δν)} f(t) \sin (2πnΔνt) dt,
$$
for $n > 0$, and
$$A_0 = Δν \int^{+1/(2Δν)}_{-1/(2Δν)} f(t) dt,\quad B_0 = 0.$$
Thus,
$$
A_n = \frac1L \int^{+L}_{-L} f(t) \cos \frac{πnt}L dt,\quad B_n = \frac1L \int^{+L}_{-L} f(t) \sin \frac{πnt}L dt\quad (n > 0),\\
A_0 = \frac1{2L} \int^{+L}_{-L} f(t) dt,\quad B_0 = 0.
$$
(You forgot to list the integral expressions for $B_n$ in your query, and for $A_n$, it's $πnt$ in the numerator, not $2πnt$.)
Going in reverse, you have
$$\hat{f}(+nΔν) = L\left(A_n - i B_n\right),\quad \hat{f}(-nΔν) = L\left(A_n + i B_n\right),\quad (n ∈ \{1,2,3,⋯\}),\\
\hat{f}(0) = 2LA_0,\quad B_0 = 0.
$$
Thus,
$$\begin{align}
f(t)
&= \hat{f}(0) Δν + \sum_{n>0} \left(\hat{f}(+nΔν) 1^{+nΔνt} + \hat{f}(-nΔν) 1^{-nΔνt}\right) Δν\\
&= \frac{2LA_0}{2L} + \sum_{n>0} \frac{L\left(A_n - i B_n\right)\left(\cos \tfrac{2πnt}{2L} + i \sin \tfrac{2πnt}{2L}\right) + L\left(A_n + i B_n\right)\left(\cos \tfrac{2πnt}{2L} - i \sin \tfrac{2πnt}{2L}\right)}{2L}\\
&= A_0 + \sum_{n>0} \left(A_n \cos \frac{πnt}L + B_n \sin \frac{πnt}L\right)\\
&= \sum_{n≥0} \left(A_n \cos \frac{πnt}L + B_n \sin \frac{πnt}L\right).
\end{align}$$