[proofplan]
We prove that $f^*(\alpha \smile \beta) = f^*\alpha \smile f^*\beta$ for any continuous map $f: X \to Y$ and cohomology classes $\alpha \in H^k(Y; R)$, $\beta \in H^\ell(Y; R)$. The proof is a direct computation at the cochain level: the pullback $f^*$ is defined by precomposition with the induced chain map $f_\#$, and the cup product evaluates cochains on front and back faces. We show $f^*(\phi \smile \psi) = (f^*\phi) \smile (f^*\psi)$ for cocycles $\phi, \psi$, and the identity descends to cohomology.
[/proofplan]
[step:Recall the pullback map on cochains]
Let $f: X \to Y$ be a continuous map. The induced chain map $f_\#: C_n(X) \to C_n(Y)$ sends a singular $n$-simplex $\sigma: \Delta^n \to X$ to $f \circ \sigma: \Delta^n \to Y$. The pullback on cochains is
\begin{align*}
f^*: C^\ell(Y; R) &\to C^\ell(X; R), \quad (f^*\phi)(\sigma) = \phi(f_\#(\sigma)) = \phi(f \circ \sigma).
\end{align*}
The pullback is a cochain map: $f^* \circ d^Y = d^X \circ f^*$, which follows from $f_\#$ being a chain map. Therefore $f^*$ sends cocycles to cocycles and coboundaries to coboundaries, inducing a well-defined map $f^*: H^\ell(Y; R) \to H^\ell(X; R)$.
[/step]
[step:Verify the identity $f^*(\phi \smile \psi) = (f^*\phi) \smile (f^*\psi)$ at the cochain level]
Let $\phi \in C^k(Y; R)$ and $\psi \in C^\ell(Y; R)$. For any singular $(k+\ell)$-simplex $\sigma: \Delta^{k+\ell} \to X$ with vertices $v_0, \ldots, v_{k+\ell}$, we compute the left-hand side:
\begin{align*}
f^*(\phi \smile \psi)(\sigma) &= (\phi \smile \psi)(f \circ \sigma) \\
&= \phi\bigl((f \circ \sigma)|_{[v_0, \ldots, v_k]}\bigr) \cdot \psi\bigl((f \circ \sigma)|_{[v_k, \ldots, v_{k+\ell}]}\bigr).
\end{align*}
Since the restriction of a composition to a face is the composition of the restriction — that is, $(f \circ \sigma)|_{[v_0,\ldots,v_k]} = f \circ (\sigma|_{[v_0,\ldots,v_k]})$ — this becomes
\begin{align*}
f^*(\phi \smile \psi)(\sigma) = \phi\bigl(f \circ \sigma|_{[v_0,\ldots,v_k]}\bigr) \cdot \psi\bigl(f \circ \sigma|_{[v_k,\ldots,v_{k+\ell}]}\bigr).
\end{align*}
Now we compute the right-hand side:
\begin{align*}
((f^*\phi) \smile (f^*\psi))(\sigma) &= (f^*\phi)\bigl(\sigma|_{[v_0,\ldots,v_k]}\bigr) \cdot (f^*\psi)\bigl(\sigma|_{[v_k,\ldots,v_{k+\ell}]}\bigr) \\
&= \phi\bigl(f \circ \sigma|_{[v_0,\ldots,v_k]}\bigr) \cdot \psi\bigl(f \circ \sigma|_{[v_k,\ldots,v_{k+\ell}]}\bigr).
\end{align*}
The two expressions are identical. Therefore $f^*(\phi \smile \psi) = (f^*\phi) \smile (f^*\psi)$ as cochains.
[guided]
The naturality of the cup product is one of the simplest proofs in the theory, and it follows from a single observation: restricting to a face commutes with precomposing by $f$. More explicitly, the operation of taking the front $k$-face of a singular simplex $\sigma$ and then composing with $f$ is the same as first composing $\sigma$ with $f$ and then taking the front $k$-face.
This commutativity is a purely formal consequence of the fact that face restrictions are defined by precomposition with face inclusions $\delta: \Delta^k \to \Delta^{k+\ell}$: we have $(f \circ \sigma) \circ \delta = f \circ (\sigma \circ \delta)$, which is just associativity of function composition.
The proof requires no hypothesis verification and no chain homotopy argument — it works at the cochain level, not merely on cohomology. This makes the cup product's naturality even stronger than, say, its graded commutativity, which only holds on cohomology (not on cochains).
[/guided]
[/step]
[step:Descend to cohomology]
Since $f^*(\phi \smile \psi) = (f^*\phi) \smile (f^*\psi)$ holds at the cochain level, it immediately holds on cohomology classes. For cocycles $\phi$ representing $\alpha \in H^k(Y; R)$ and $\psi$ representing $\beta \in H^\ell(Y; R)$:
\begin{align*}
f^*(\alpha \smile \beta) = f^*([\phi \smile \psi]) = [f^*(\phi \smile \psi)] = [(f^*\phi) \smile (f^*\psi)] = f^*\alpha \smile f^*\beta.
\end{align*}
Combined with the fact that $f^*$ preserves the unit ($f^*([1_Y]) = [1_X]$, since $(f^*1_Y)(\sigma) = 1_Y(f \circ \sigma) = 1_R = 1_X(\sigma)$ for every $0$-simplex $\sigma$), we conclude that
\begin{align*}
f^*: H^*(Y; R) \to H^*(X; R)
\end{align*}
is a homomorphism of graded $R$-algebras. That is, $f^*$ preserves both the additive structure (as an $R$-module map) and the multiplicative structure (as a ring homomorphism respecting the cup product and unit).
[/step]