For continuity at \( x = 0 \), the limit of \( f(x) \) as \( x \) approaches 0 must equal \( f(0) \). We evaluate the limit: \[ \lim_{x \to 0} \frac{\sin^2(ax)}{x^2}. \] Using the approximation \( \sin(x) \approx x \) as \( x \to 0 \), we get \( \sin(ax) \approx ax \), which implies \( \sin^2(ax) \approx a^2 x^2 \). Substituting this into the limit: \[ \lim_{x \to 0} \frac{a^2 x^2}{x^2} = a^2. \] For continuity, this limit must equal \( f(0) = 1 \). Thus: \[ a^2 = 1, \quad a = \pm 1. \] The value of \( a \) is \( \pm 1 \).