Let $\omega = (p_x)_{x\in\mathbb{Z}}$ be an i.i.d. collection of (0, 1)-valued random variables. Given $\omega$, let $(X_n)_{n \geq 0}$ be the Markov chain on $\mathbb{Z}$ defined by $X_0 = 0$ and $X_{n + 1} = X_n + 1(\operatorname{resp}. X_n - 1)$ with probability $p_{X_n}(\operatorname{resp}.1 - p_{X_n})$. It is shown that $X_n/n$ satisfies a large deviation principle with a continuous rate function, that is, $\lim_{n\rightarrow\infty}\frac{1}{n}\log P_\omega(X_n = \lfloor\theta_nn\rfloor) = -I(\theta) \omega-\mathrm{a.s.}\text{for} \theta_n\rightarrow\in\lbrack -1, 1\rbrack.$ First, we derive a representation of the rate function $I$ in terms of a variational problem. Second, we solve the latter explicitly in terms of random continued fractions. This leads to a classification and qualitative description of the shape of $I$. In the recurrent case $I$ is nonanalytic at $\theta = 0$. In the transient case $I$ is nonanalytic at $\theta = -\theta_c, 0, \theta_c$ for some $\theta_c \geq 0$, with linear pieces in between.