> probability of a precise number to be chosen out of continuous interval is 0

You're right, but what you says is probability _mass_ function (PMF), and what the question says is probability _density_ function (PDF).

For example, $\Pr(X = 1.5) = 0$ but $\Pr(1.5 < X \leq 1.6) > 0$ and $\Pr(1.5 < X \leq 1.5 + \Delta x) > 0$. Moreover, $\Pr(1.5 < X \leq 1.5 + \Delta x)$ is roughly proportional to $\Delta x$ and $\lim_{\Delta x \to 0} \Pr(1.5 < X \leq 1.5 + \Delta x) / \Delta x$ (probability mass / range) is called probability density.

---

We'll derive by CDF, because definition of CDF contains a “$\leq$”, which is suitable for describing the minimum.

CDF of each number is

$$
F(x) = \begin{cases}
0 & x \leq 1. \\
x-1 & 1 < x \leq 2. \\
1 & x > 2.
\end{cases}
$$

Now can you follow Henry's comment?

(It's not necessary to fully understand PDF for calculating CDF)