6. The function $f(x)$ is defined on the set of real numbers and satisfies:
$$
f(x)-\frac{1}{2} f\left(\frac{x}{2}\right)=x^{2} \text {. }
$$

Then $f(x)=$ $\qquad$
6. $\frac{8}{7} x^{2}$.

Note that the condition contains $x^{2}$, use a polynomial as the undetermined function, set $f(x)=a x^{2}+b x+c$.
Substitute into the condition, we have
$$
\left(a x^{2}+b x+c\right)-\frac{1}{2}\left(a \cdot \frac{x^{2}}{4}+b \cdot \frac{x}{2}+c\right)=x^{2},
$$

Comparing both sides of the identity, we get
$$
b=c=0, a=\frac{8}{7} .
$$

Therefore, $f(x)=\frac{8}{7} x^{2}$.