Solar oblateness has been the subject of several studies dating back to the nineteenth century. Despite difficulties, both theoretical and observational, tangible results have been achieved. However, variability of the solar oblateness with time is still poorly known. How the solar shape evolves with the solar cycle has been a challenging problem. Analysis of the helioseismic data, which are the most accurate measure of the solar structure up to now, leads to the determination of asphericity coefficients which have been found to change with time. We show here that by inverting even coefficients of f-mode oscillation frequency splitting to obtain the oblateness magnitude and its temporal dependence can be inferred. It is found that the oblateness variations lag the solar activity cycles by about 3 years. A major change occurred between solar cycles 23 and 24 is that the oblateness was greater in cycle 24 despite the lower solar activity level. Such results may help to better understand the near-subsurface layers as they strongly impacts the internal dynamics of the Sun and may induce instabilities driving the transport of angular momentum.