Solution (source code)

= Solution

The sphere $\{p\}\times S^2$ in $S^1\times S^2$ is nonseparating: its complement is $(S^1\setminus\{p\})\times S^2$, which is connected. A sphere bounding a ball separates, so this product is not an <irreducible three-manifold>.

To show it is prime, suppose a separating sphere cuts it into compact pieces $V,W$ with one spherical boundary each. The <Seifert-van Kampen theorem> gives
$$
\mathbb Z\cong\pi_1(S^1\times S^2)\cong\pi_1(V)*\pi_1(W).
$$
A <free product> of two nontrivial groups is nonabelian: choose nonidentity elements in the two factors; their products in the two orders are distinct reduced words. Hence one factor, say $\pi_1(V)$, is trivial. The inclusion of this simply connected compact piece lifts to the universal cover $\mathbb R\times S^2\cong\mathbb R^3\setminus\{0\}$. The lift is an embedding: equality of lifted points would imply equality of their projections in $V$. Its image $\widetilde V$ is compact with boundary the lifted sphere.

Use the <three-dimensional Schoenflies theorem>: a locally flat embedded sphere in $\mathbb R^3$ bounds a ball, and its compact side is that ball. The interior of $\widetilde V$ is both open and closed in the corresponding complement component, and <compactness> rules out the unbounded component. Thus $\widetilde V$ is the bounded ball, and $V$ itself is a ball. Capping $V$ gives $S^3$, so every connected-sum decomposition is trivial. Therefore \b[$S^1\times S^2$ is prime but not irreducible].

Now let a prime closed connected orientable $M$ fail irreducibility. A sphere not bounding a ball cannot separate: if it did, primeness would make one capped side $S^3$, and the <three-dimensional Schoenflies theorem> would make its uncapped side a ball. Thus there is a nonseparating sphere $S$. Its two-sided neighborhood is $S^2\times[-1,1]$. Since the complement is connected, join its two boundary spheres by an embedded arc in that complement and thicken the arc. The union is a punctured $S^2\times S^1$: the thickened arc joins the two ends of the sphere-cylinder, and the remaining boundary is one sphere. This is the <nonseparating sphere gives a sphere-circle summand> construction and yields
$$
M\cong(S^1\times S^2)\mathbin\#N.
$$
The product is not $S^3$, since its <fundamental group> is $\mathbb Z$. Primeness forces $N\cong S^3$, so
$$
\boxed{M\cong S^1\times S^2.}
$$
The background results used are van Kampen, the explicit universal cover of the product, and the locally flat three-dimensional Schoenflies theorem; no Poincaré-conjecture argument is needed.