Example of a smooth morphism where you can't lift a map from a nilpotent thickening? 
Definition. A locally finitely presented morphism of schemes $f\colon X\to Y$ is smooth (resp. unramified, resp. étale) if for any affine scheme $T$, any closed subscheme $T_0$ defined by a square zero ideal $I$, and any morphisms $T_0\to X$ and $T\to Y$ making the following diagram commute

    g
T0 --> X
|      |
|      |f
v      v
T ---> Y

there exists (resp. exists at most one, resp. exists exactly one) morphism $T\to X$ which fills the diagram in so that it still commutes.

For checking that $f$ is unramified or étale, it doesn't matter that I required $T$ to be affine. The reason is that for an arbitrary $T$, I can cover $T$ by affines, check if there exists (a unique) morphism on each affine, and then "glue the result". If there's at most one morphism locally, then there's at most one globally. If there's a unique morphism locally, then there's a unique morphism globally (uniqueness allows you to glue on overlaps).
But for checking that $f$ is smooth, it's really important to require $T$ to be affine in the definition, because it could be that there exist morphisms $T\to X$ locally on $T$, but it's impossible to find these local morphisms in such a way that they glue to give a global morphism.

Question: What is an example of a smooth morphism $f\colon X\to Y$, a square zero nilpotent thickening $T_0\subseteq T$ and a commutative square as above so that there does not exist a morphism $T\to X$ filling in the diagram?

I'm sure I worked out such an example with somebody years ago, but I can't seem to reproduce it now (and maybe it was wrong). One thing that may be worth noting is that the set of such filling morphisms $T\to X$, if it is non-empty, is a torsor under $Hom_{\mathcal O_{T_0}}(g^*\Omega_{X/Y},I)=\Gamma(T_0,g^*\mathcal T_{X/Y}\otimes I)$, where $\mathcal T_{X/Y}$ is the relative tangent bundle. So the obstruction to finding such a lift will represent an element of $H^1(T_0,g^*\mathcal T_{X/Y}\otimes I)$ (you can see this with Čech cocycles if you want). So in any example, this group will have to be non-zero.
 A: The kind of example that comes easily to mind is where $X=L$ is a line bundle over $Y$, a smooth projective variety over, say, $\mathbb{Z}_p$. We take $T=Y$ and $T_0=Y_0$, the special fiber of $Y$. Then $L$ can have plenty of sections over $Y_0$ that refuse to lift to $Y$. Note that this implies what you want, since if the sections could be lifted repeatedly over square-zero ideals, then they could be lifted all the way to $Y$. (By formal GAGA, if you want.) That is, replace the original $Y_0$ by  $Y\otimes \mathbb{Z}/p^n$ for larger $n$.
One place you can see this spelled out with $L$ the tensor powers of the canonical bundle $\omega_{Y/\mathbb{Z}_p}$ ('jump of plurigenera') is a paper by Junecue Suh:
Compos. Math. 144 (2008), no. 5, 1214–1226. (Unfortunately, I have no link that doesn't require a log-in.)
I think he constructs examples where the jump is arbitrarily large even for Shimura surfaces. 
This example is probably overly pathological, and I suspect you can construct more commonplace $L$.
A: Suppose that $X \to Y$ is a smooth map of varieties, and denote by $Y'$ the relative spectrum of $\mathcal O_Y[t]/(t^2)$. The liftings of $X \to Y$ to $Y'$ are parametrized by $\mathrm H^1(X, \mathrm T_{X/Y})$. Now suppose that $X' \to Y'$ is a lifting $s\colon Y \to X$ is a section; it is easy to see that the obstruction to lifting $s$ to a section $Y' \to X'$ is the image of the element of $\mathrm H^1(X, \mathrm T_X/Y)$ into $\mathrm H^1(Y, \mathrm s^*T_{X/Y})$; so to give an example where the section doesn't lift it is enough to give examples in which the map $\mathrm H^1(X, \mathrm T_{X/Y}) \to \mathrm H^1(Y, \mathrm s^*T_X/Y)$ is not 0. This is easy; for example, one can take $L$ to be a line bundle on $Y$ with $\mathrm H^1(Y,L) \neq 0$, and $f\colon X \to Y$ to be the total space of $L$. In this case what is happening is that $X' \to Y'$ is a non-trivial $L$-torsor, so the trivial section $Y \to L$ does not lift.
Another type of example is of the type suggested by Minhyong. Take $Y$ to be a projective variety over $k$ with $\mathrm H^0(Y, \mathcal O)  = k$ and $\mathrm H^1(Y, \mathcal O) \neq 0$; let $Y'$ be as before. There exists a non-trivial line bundle $L'$ on $Y'$ whose restriction to $Y$ is $\mathcal O_Y$; then the only section of $\mathcal O_Y$ that lifts is the zero section.
A: Using some of BCnrd's ideas together with a different construction, I'll give a positive answer to Kevin Buzzard's stronger question; i.e., there is a counterexample for any non-etale smooth morphism.
Call a morphism $X \to Y$ wicked smooth if it is locally of finite presentation and for every (square-zero) nilpotent thickening $T_0 \subseteq T$ of $Y$-schemes, every $Y$-morphism $T_0 \to X$ lifts to a $Y$-morphism $T \to X$.

Theorem: A morphism is wicked smooth if and only if it is etale.

Proof:
Anton already explained why etale implies wicked smooth.  
Now suppose that $X \to Y$ is wicked smooth.  In particular, $X \to Y$ is smooth, so it remains to show that the geometric fibers are $0$-dimensional.  Wicked smooth morphisms are preserved by base change, so by base extending by each $y \colon \operatorname{Spec} k \to Y$ with $k$ an algebraically closed field, we reduce to the case $Y=\operatorname{Spec} k$.  Moreover, we may replace $X$ by an open subscheme to assume that $X$ is etale over $\mathbb{A}^n_k$ for some $n \ge 0$.
Fix a projective variety $P$ and a surjection $\mathcal{F} \to \mathcal{G}$ of coherent sheaves on $P$ such that some $g \in \Gamma(P,\mathcal{G})$ is not in the image of $\Gamma(P,\mathcal{F})$.  (For instance, take $P = \mathbb{P}^1$, let $\mathcal{F} = \mathcal{O}_P$, and let $\mathcal{G}$ be the quotient corresponding to a subscheme consisting of two $k$-points.)  Make $\mathcal{O}_P \oplus \mathcal{F}$ an $\mathcal{O}_P$-algebra by declaring that $\mathcal{F} \cdot \mathcal{F} = 0$, and let $T = \operatorname{\bf Spec}(\mathcal{O}_P \oplus \mathcal{F})$.  Similarly, define $T_0 = \operatorname{\bf Spec}(\mathcal{O}_P \oplus \mathcal{G})$, which is a closed subscheme of $T$ defined by a nilpotent ideal sheaf.  We then may view $g = 0+g \in \Gamma(P,\mathcal{O}_P \oplus \mathcal{G}) = \Gamma(T_0,\mathcal{O}_{T_0})$.
Choose $x \in X(k)$; without loss of generality its image in $\mathbb{A}^n(k)$ is the origin.  Using the infinitesimal lifting property for the etale morphism $X \to \mathbb{A}^n$ and the nilpotent thickening $P \subseteq T_0$, we lift the point $(g,g,\ldots,g) \in \mathcal{A}^n(T_0)$ mapping to $(0,0,\ldots,0) \in \mathbb{A}^n(P)$ to some $x_0 \in X(T_0)$ mapping to $x \in X(k) \subseteq X(P)$.  By wicked smoothness, $x_0$ lifts to some $x_T \in X(T)$.  The image of $x_T$ in $\mathbb{A}^n(T)$ lifts $(g,g,\ldots,g)$, so each coordinate of $x_T$ is a global section of $\mathcal{F}$ mapping to $g$, which is a contradiction unless $n=0$.  Thus $X \to Y$ is etale.
A: Let $Y=\operatorname{Spec} k$ and let $X=\mathbb{P}^1_k$, viewed as $\operatorname{Spec} k[t]$ glued to $\operatorname{Spec} k[t^{-1}]$.
Let $T = \operatorname{\bf Spec}(\mathcal{O}_X + \mathcal{O}_X(-2)\epsilon + \mathcal{O}_X(-4) \epsilon^2)$ where $\epsilon^3=0$, so $T$ is
$$\operatorname{Spec}(k[t] + k[t]\epsilon + k[t]\epsilon^2)$$
glued to
$$\operatorname{Spec}(k[t^{-1}] + t^{-2} k[t^{-1}]\epsilon + t^{-4} k[t^{-1}]\epsilon^2).$$
Let $I$ be the ideal sheaf of $\mathcal{O}_T$ generated by $\epsilon^2$,
and let $T_0$ be the associated subscheme.
Consider the $k$-morphism $T_0 \to X$ given by
$$t \mapsto t + \epsilon$$
$$t^{-1} \mapsto t^{-1} - t^{-2} \epsilon.$$
(Check that this is well-defined, i.e., that $(t+\epsilon)(t^{-1} - t^{-2} \epsilon) = 1$ in $k[t,t^{-1}][\epsilon]/(\epsilon^2)$.)
A lift of this to a morphism $T \to X$ has the form
$$t \mapsto t + \epsilon + f(t) \epsilon^2$$
$$t^{-1} \mapsto t^{-1} - t^{-2} \epsilon + t^{-4} g(t^{-1}) \epsilon^2$$
for some polynomials $f$ and $g$, but the compatibility condition is now
$$t^{-3} g(t^{-1}) - t^{-2} + t^{-1} f(t) = 0,$$
which has no solution.
Note: If we replaced $\mathcal{O}(-4)$ with $\mathcal{O}(-3)$, then there would be a lifting, given by the Taylor polynomials of $t$ and $t^{-1}$, i.e.,
$$t \mapsto t + \epsilon$$
$$t^{-1} \mapsto \frac{1}{t+\epsilon} = t^{-1} - t^{-2} \epsilon + t^{-3} \epsilon^2.$$
