Step 1: Setting up with an intermediate variable:
Let $y = f(x)$, so by definition $y = \cos x$.
The rule of $g$ is: whatever number enters, square it and multiply by 3, that is $g(y) = 3y^2$.
Step 2: Checking with sample values:
At $x = 0$: $f(0) = \cos 0 = 1$, so $g(f(0)) = 3(1)^2 = 3$.
At $x = \pi/2$: $f(\pi/2) = \cos(\pi/2) = 0$, so $g(f(\pi/2)) = 3(0)^2 = 0$.
Both values match the pattern $3\cos^2 x$ evaluated at these points, confirming the rule.
Step 3: Writing the general formula:
Since $y = \cos x$ for every real $x$, substituting into $g(y) = 3y^2$ for a general $x$ gives:
\[ (gof)(x) = 3(\cos x)^2 = 3\cos^2 x \]
Final Answer:
Both the direct substitution and the point-check method give the same composed rule.
\[ \boxed{(gof)(x) = 3\cos^2 x} \]