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 ---> Ythere 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.