I hope it's ok to post a more detailed version, maybe OP (or other users) will benefit from it.
$\newcommand{\norm}[1]{\lVert{#1}\rVert}\newcommand{\abs}[1]{|{#1}|}$I suppose you work with sup norm $\norm{x}=\sup_{t\in[a,b]}\abs{x(t)}$, since this is the usual meaning of $C(X)$.
We know that $C[a,b]$ is complete (it is a Banach space). Recall that a subspace of a complete metric space is complete if and only if it is closed. (A proof of this result can be found at proofwiki.) So it suffices to show that $Y$ is closed in $C[0,1]$.
Now I think that it is quite clear that if a sequence of functions $(x_n)$ converges to $x$ uniformly and $x_n(a)=x_n(b)$, then $x(a)=x(b)$. (Even pointwise convergence would be sufficient for this last argument.)