Let $C$ be a smooth projective curve. Is it true that
$$\textrm{Aut}(C\times C)\cong S_2 \ltimes (\textrm{Aut}(C)\times \textrm{Aut}(C))$$
and in case, what would be a reference for this? Thanks.
This is a particular case of a more general rigidity result, whose proof (similar to the one given in abx's answer) can be found in Lemma 3.8 of
F. Catanese, Fibred surfaces, varieties isogenous to a product and related moduli spaces, Amer. J. Math. 122 (2000), no. 1, 1-44.
Proposition. Let $f \colon C_1 \times C_2 \longrightarrow B_1 \times B_2$ be a surjective holomorphic map between products of curves. Assume that both $B_1$ and $B_2$ have genus $\geq 2$. Then, after possibly exchanging $B_1$ with $B_2$, there are holomorphic maps $f_i \colon C_i \to B_i$ such that $$f(x, \, y) = (f_1(x), \, f_2(y)).$$
That is certainly not true. Consider the case that $C$ is an elliptic curve. Then $\text{Aut}(C\times C)$ contains $\text{GL}(2,\mathbb{Z})$ as a subgroup.
It is true if $g(C)\geq 2$. The point is that if you map nontrivially $C$ to $C\times C$, the projections of the image on each factor have degree $0$ or $1$ (say, by Hurwitz formula). Thus the image is either $C\times \{p\} $ or $\{q\}\times C $ for some $p,q\in C$, or it is the graph of an automorphism. Since $\mathrm{Aut}(C)$ is finite for $g(C)\geq 2$, your statement follows easily.