$X$ is a algebraic variety. $\mathcal{F}$ is a coherent sheaf. $U\subset X$ is an open dense subset. $\mathcal{F}|_U$ is locally free on $U$.
Can we conclude that $\mathcal{F}$ is locally free on $X$ ?
$X$ is a algebraic variety. $\mathcal{F}$ is a coherent sheaf. $U\subset X$ is an open dense subset. $\mathcal{F}|_U$ is locally free on $U$.
Can we conclude that $\mathcal{F}$ is locally free on $X$ ?
No.
Take $X=\mathbb A^2_k\:$ and for $\mathcal F\subset \mathcal O_X$ take the ideal sheaf of some rational point $P\in X$.
If $U$ is the open dense subset $U=X\setminus \{P\}\subset X$, then $\mathcal F\vert U=\mathcal O_U$ is free of rank one.
Nevertheless $\mathcal F$ is not locally free because its stalk $\mathcal F_P$ is not free as an $\mathcal O_P$-module.
Edit: proof of non-freeness of $\mathcal F_P$
Say $P=(0,0)$ Then $\mathcal O_P=k[X,Y]_{\langle X,Y\rangle }$ and the stalk $\mathcal F_P$ is the maximal ideal $\mathcal F_P=\langle X,Y\rangle \mathcal O_P\subset \mathcal O_P$.
Since $\mathcal O_P$ is of dimension $2$ its maximal ideal is of height $2$ and thus cannot be generated by a single element (Krull). Hence $\mathcal F_P$ is a non-principal ideal and is thus not free as an $\mathcal O_P$-module.