To check that $f \to f \circ g$ is continuous in $f$ as a map $X^X \to X^X$ for a fixed $g \in X^X$: take a net $f_i \to f$ ($i \in I$, some directed set) in $X^X$ converging to $f \in X^X$. This means exactly that $$\forall x \in X: f_i(x) \to f(x)\tag{1}$$ in $X$. So in particular for any $x \in X$, $(f_i \circ g)(x) = f_i(g(x)) \to f(g(x)) = (f \circ g)(x)$, applying $(1)$ to $g(x)$ as the evaluation point. This means exactly that $(f_i \circ g) \to (f \circ g)$ in $X^X$ by the characterisation of the product topology by pointwise convergence (of nets). So indeed $f \to f \circ g$ is continuous on $X^X$.
Alternatively, in terms of subbases: a standard subbasic element of $X^X$ is of the form $\pi_x^{-1}[O]$ with $O$ open in $X$ (with $\pi_x:X^X \to X, f \to f(x)$ a standard projection for $x \in X$) and then, denoting the composition on the right by $g$ as the map $R_g$, say, we see that
$$R_g^{-1}[\pi_x^{-1}[O]] = \{f \in X^X\mid R_g(f) \in \pi_x^{-1}[O]\}= \{f \in X^X\mid f(g(x))\in O\}=\pi_{g(x)}^{-1}[O]$$
which is also subbasic open, and so $R_g$ is continuous that way too. Composing by $g$ on the left we have
$$L_g^{-1}[\pi_x^{-1}[O]] = \{f \in X^X\mid L_g(f) \in \pi_x^{-1}[O]\} = \{f \in X^X\mid g(f(x)) \in O\} = \\= \{f \in X^X\mid: f(x) \in g^{-1}[O]\} = \pi_x^{-1}[g^{-1}[O]]$$$$L_g^{-1}[\pi_x^{-1}[O]] = \{f \in X^X\mid L_g(f) \in \pi_x^{-1}[O]\} = \{f \in X^X\mid g(f(x)) \in O\} = \\= \{f \in X^X\mid f(x) \in g^{-1}[O]\} = \pi_x^{-1}[g^{-1}[O]]$$
which is then also subbasic open, assuming indeed that $g$ is continuous. The nets proof can be similarly adapted for that second case (left as an easy exercise).