Definition 0. Let $A$ and $B$ denote smooth manifolds. Then a smooth relation $A \rightarrow B$ is a smooth submanifold of $A \times B$.
Definition 1. Given relations $P : A \rightarrow B$ and $Q : B \rightarrow C$, define a relation $Q \circ P : A \rightarrow C$ in the usual way:
$$(a,c) \in Q \circ P \leftrightarrow \exists b \in B((b,c) \in Q \wedge (a,b) \in P)$$
Question. Do there exist smooth relations $P : A \rightarrow B$ and $Q : B \rightarrow C$ such that $Q \circ P$ fails to be smooth?
I suspect the answer is "yes", for the following reason: given submanifolds $P \subseteq A \times B$ and $Q \subseteq B \times C$, my geometric intuition tells me that the submanifolds $P \times C$ and $A \times Q$ don't necessarily intersect transversally. For instance, think of $A=B=C=\mathbb{R}$. Assume $P$ and $Q$ are the unit circle. Then $P \times \mathbb{R}$ and $\mathbb{R} \times Q$ are cylinders at right angles to each other. There should be points where these don't intersect transversally. Maybe that helps.