Define the functional $x^* : X \to \mathbb R$ via $x^*(f)= \int_0^1 f$. Clearly $||x^*|| \leq 1$. In fact, $||x^*|| =1$. To see this, consider the functions $f_n \in X$ defined by $f_n(t)=1 $ on $[0,1-1/n]$ and $f_n(t) =\frac 1n (1-t)$ on $(1-1/n,1]$. Evidently $ x^*(f_n)=1-\frac{1}{2n}$ and so $||x^*|| \geq 1 - \frac{1}{2n} $ for all $n$.
Notice that $Y = \ker x^*$. It is well known that $dist(f,\ker x^*) = \frac{|x^*(f)|}{||x^*||} = |x^*(f)|$. Assume that there exists $f$ with norm one such that $|x^*(f)|=|\int_0^1 f |=1$. Since
$$ 1= | \int_0^1 f | \leq \int_0^1 |f| \leq 1$$
we see that $ \int_0^1 |f| =1$ or equivalenty that $ \int_0^1( 1- |f|)=0$. However, $1- |f| \geq 0 $ and so $|f|\equiv 1$. This is impossible since $f(1)=0$.
A nice byproduct of this is that X is not reflexive. Indeed, as we showed $x^*$ does not attain its norm and so by James's theorem we infer that X is not reflexive.
$\textbf{Edit:}$ Generally, if $X$ is a non reflexive space, then by James theorem there exists $x^* \in X^*$ that is not norm attaining. The above shows that $ dist(x, \ker x^*) <1$ for all $x \in X$ with norm one.