This is actually nothing other than the extremely surprising Railroad Track Problem that is wonderfully written about in Forman S. Acton's Numerical Methods That (usually) Work. What follows is a full solution, so you might want to stop reading my answer and instead go read the book, if you do not want spoilers.
The existing solutions above are correct that you do have to find a numerical solution. But they are not developed enough. With a bit more work, you can get something much more useful.
It is not nice to work with $L$ and $x$, but instead $\dfrac L2$ and $\dfrac x2$ are much more convenient.
$$
\begin{align}
\tag1R\sin\vartheta&=\frac x2\\
\tag2R \vartheta&=\frac L2\\
\tag3h&=R(1-\cos\vartheta)
\end {align}
$$
I am using a geometry similar to that in the Wolfram link, but with a replacement of notation to yours.
Now, as $x\to L$, the interpretation is that $R\to\infty$ and $\vartheta\to0$, and you should be able to see that the equations can be made to work. The result is that $h\to0$, so your function $f(x)=h+1$, adding the one just to take care of the thickness of the line.
Those equations have both $R$ and $\vartheta$ intertwined, but if you find $\vartheta$ in any way, then Equation (2) gives you a way to find $R$, so then you can solve the whole thing. Dividing Equations (1) and (3) by Equation (2), we get
$$
\begin{align}
\tag4\text{sinc}\,\vartheta\overset{\text{def}}=\frac{\sin\vartheta}\vartheta&=\frac xL\\
\tag5h&=\frac L2\cdot\frac{1-\cos\vartheta}\vartheta=\frac L2\cdot\frac{2\sin^2\frac\vartheta2}{2\frac\vartheta2}=\frac L2\cdot\frac\vartheta2\text{sinc}^2\frac\vartheta2
\end {align}
$$
And so it turns out, the solution does not depend upon knowing $R$ at all. That is, from Equation (4), you numerically find the value of $\vartheta$, and then in Equation (5) you can compute everything. The sinc function is implemented in basically every computer maths library and so computing it in Equation (5) is super easy and cheap.
However, the inverse, as needed in Equation (4), is much less used, and much less implemented. In the limit $x\to L$, simply expand the sinc function as a Taylor series, keeping two terms to get the first estimate for $\vartheta$, and then you can unleash Newton–Raphson method to get incredibly good approximations extremely quickly and cheaply, and in this case it is guaranteed to work wonderfully.
As for when $0\leqslant x\ll L$, it is then safe to start with the approximation $\frac{\sin\vartheta}{\frac\pi2}\approx\frac xL$ and then use Newton–Raphson on it yet again. That is, Newton–Raphson is basically the main workhorse that you can even implement on a school scientific calculator.