Can the fundamental group detect all ways to not have a section? A common homework problem in topology classes is to find a quotient map $p : X \to Y$ which does not admit a (continuous) section $s : Y \to X$. The standard example of such a phenomenon is the map $[0,1] \to S^1$ which identifies the endpoints (or some variant on this theme, for instance $\mathbb{R} \to S^1$ is just as good).
One (perhaps overkill) way to see that this map fails to have a section is to look at what such a section would mean for the fundamental groups. $\pi_1 [0,1] = 1$ and $\pi_1 S^1 = \mathbb Z$. So if a section did exist, then the induced map on fundamental groups would mean the identity factors as $\mathbb Z \to 1 \to \mathbb Z$. Contradiction.
The question then: Provided our spaces are nice enough, does this same proof work for every quotient without a section? Or are there spaces $X$ and $Y$ so that $p: X \to Y$ has no section, but factoring the identity as $\pi_1 Y \to \pi_1 X \overset{\pi_1 p}{\to} \pi_1 Y$ is abstractly possible?
As a bonus question, is there categorical language for this phenomenon? I think I'm asking if $\pi_1$ reflects split monos, but I'm not quite confident enough to phrase my question that way.

Thanks in advance!
 A: Every functor $F$ preserves sections (or equivalently, preserves split monomorphisms, or equivalently, preserves split epimorphisms), and so every functor $F$ whatsoever is an obstruction to a map having a section: this means $\pi_1$ but also the higher $\pi_n$ and the homologies $H_n$ and the cohomology ring, but also even non-homotopy invariants. It's easy for the $\pi_1$ obstruction to vanish by taking all the spaces involved to be simply connected and then other obstructions can be used, as with Ted Shifrin's example.
Abstractly, the "maximal" functor $F$ obstructing the existence of a section, for an arbitrary category $C$, is the Yoneda embedding $Y : C \to [C^{op}, \text{Set}]$, and in fact you can show:

Exercise: A map $f : x \to y$ has a section iff the induced map $Y(f) : Y(x) \to Y(y)$ under the Yoneda embedding is an epimorphism (meaning that it is pointwise surjective as a map of presheaves).

I wrote a blog post Topological Diophantine equations in which I explored the analogy between finding sections of a map of topological spaces and finding solutions to systems of polynomial Diophantine equations (the point being that finding an integer solution to a system of integer polynomials $\{ f_i \}$ is equivalent to finding a section of the structure map $\text{Spec } \mathbb{Z}[\{x_i\}]/(\{f_i\}) \to \text{Spec } \mathbb{Z}$). In that post I give the example of the map
$$f : [0, 1] \sqcup [1, 2] \to [0, 2]$$
(the obvious inclusions all around), which admits no section but is such that the induced map on homotopy types does (so no homotopy invariant detects this). There is a point-set obstruction: there is no section of $f$ on any open neighborhood of $1 \in [0, 2]$, and so the stalk of the sheaf of sections vanishes there. This is loosely analogous to a Diophantine equation not having a solution over $\mathbb{Q}_p$ despite having one over $\mathbb{F}_p$; $\text{Spec } \mathbb{Q}_p$ is the "open punctured infinitesimal neighborhood" of $\text{Spec } \mathbb{F}_p$ sitting inside $\text{Spec } \mathbb{Z}$.
To prevent point-set funny business you want to restrict your attention to  a suitable class of fibrations (e.g. to fiber bundles - the classic example $\mathbb{R} \to S^1$ is a covering map, so a fiber bundle with discrete fiber), which if chosen correctly should have the property that they admit sections iff they admit a section up to homotopy (equivalently, iff the induced map on homotopy types admits a section). As a special case, this is true for covering maps, and in fact $\pi_1$ detects all obstructions to the existence of a section for covering maps, although in a sort of degenerate way: a path-connected cover of a path-connected space has a section iff it's the trivial cover $X \to X$ iff the induced map on $\pi_1$ is an isomorphism.
Many important questions can be phrased as the question of whether a fiber bundle admits a section, for example the question of whether a smooth manifold admits $k$ linearly independent nowhere vanishing vector fields (the answer is famously known exactly for spheres), or the question of whether a smooth manifold admits an almost complex structure.
A: Do your same construction with $D^2\to S^2$ (identifying the boundary circle to a point). $\pi_1$ is too feeble to work here, but $\pi_2$ or $H_2$ will do.
