Is it true that if the pushforward of a coherent sheaf is locally free, then the original sheaf is locally free? I think the title says it all.  If I have a finite map $p:X\to Y$ between schemes, and $F$ is a coherent sheaf on $X$ such that $p_*F$ is locally free, can I conclude that $F$ is locally free?
Assumptions I would be happy to make:


*

*The map $p$ is flat.

*$X$ and $Y$ are both $\mathbb{A}^n$.



I would be much more pleased with a reference than a proof, since I would like to use this result in a paper.

 A: Not without condition (2).
Our counter-example takes place inside the ring $k[t,u]$. Let $A$ be the subring $k[t^2,tu,u^2]$ and $B$ the subring $k[t^2, u^2]$ of $A$. Note that $B$ is a free $A$-module, with basis $(1, tu)$, so $\mathrm{Spec} \ A$ is flat over $\mathrm{Spec} \ B$. Let $M$ be the $A$-module of odd polynomials (those with $f(-t,-u) = - f(t,u)$). 
Then $M$ is not locally free as an $A$-module. However, $M$ is free as a $B$-module, with basis $(t, u)$. Turning $M$ into a sheaf, we have a counter-example.
A: Since you asked for reference, here are some references that may be helpful  (the question is local):
1) (EDITED: Thanks to BCnrd for keeping me honest here!) If $(R,m)\to (S,n)$ is a map of  Cohen-Macaulay local rings of same dimensions, $N$ a finite $S$-module which is $R$-free flat then $${\rm{depth}}_ S N ={\rm{depth}} R = {\rm{depth}} S.$$
This follows from Prop 1.2.16 and Theorem A.11 of Bruns-Herzog "Cohen-Macaulay rings". Namely, take $M=R$ in both results, one get from A.11 that $\dim_SN = \dim_RN + \dim_SN/mN$, so $\dim_SN/mN=0$, then 1.2.16 gives  ${\rm{depth}}_SN = {\rm{depth}} R$.
2) If $S$ is regular, then f.g modules with maximal depth are free.
This is well-known. It follows from Auslander-Buchsbaum formula, as Boyarsky pointed out.
EDIT: Just to be clear, it is enought to assume: $f$ is finite, $X$ regular, and $Y$ Cohen-Macaulay scheme (certainly true if $Y$ also regular or smooth, but is a much weaker condition). For example the map induced by $k[x,y]/(xy) \to k[x]$ by killing $y$ works. 
A: The reference is "Auslander-Buchsbaum formula".  What matters is that $X$ and $Y$ are smooth of some common pure dimension $n$ (which forces flatness due to the quasi-finiteness, by the way), not that one has global affine spaces.  Then every coherent sheaf on $X$ has stalks with finite projective dimension, and so all of projective dimension zero (= locally free) precisely when the depth of each stalk is equal to the dimension of its support on the local ring. A length-$n$ regular sequence at $p(x) \in Y$ exists by the local freeness on the base, and that's such a sequence at $x$ provided that the successive quotients arising in the definition of "regular sequence" really remain nonzero when localizing upstairs. 
The completion of the $p(x)$-stalk of the pushforward is the product of the completions at the points of $p^{-1}(p(x))$, so each factor module is free and hence we're OK as long as such factor modules are all nonzero since we can use a regular sequence in the completed local ring at $p(x)$.  So we have to rule out the possibility of a vanishing completed stalk, or equivalently a vanishing stalk, upstairs.  In such cases, upon passing to connected=irreducible components, the coherent sheaf $F$ would vanish on a Zariski-dense open upstairs, and hence on some $p^{-1}(U)$ for a dense open $U$ in the base.  Then $p_ {\ast}(F)$ would vanish on $U$ and hence vanish by local freeness, so $F = 0$. The case $F = 0$ is easy to handle directly. 
