We investigate the topological properties of Fibonacci quasicrystals using cavity polaritons. Composite structures made of the concatenation of two Fibonacci sequences allow investigating generalized edge states forming in the gaps of the fractal energy spectrum. We employ these generalized edge states to determine the topological invariants of the quasicrystal. When varying a structural degree of freedom (phason) of the Fibonacci sequence, the edge states spectrally traverse the gaps, while their spatial symmetry switches: the periodicity of this spectral and spatial evolution yields direct measurements of the gap topological numbers. The topological invariants that we determine coincide with those assigned by the gap-labeling theorem, illustrating the direct connection between the fractal and topological properties of Fibonacci quasicrystals.PACS numbers: 03.65. Vf, 61.44.Br, 71.36.+c, 78.67.Pt Topology has long been recognized as a powerful tool both in mathematics and in physics. It allows identifying families of structures which cannot be related by continuous deformations and are characterized by integer numbers called topological invariants. A physical example where topological features are particularly useful is provided by quantum anomalies, i.e. classical symmetries broken at the quantum level [1], such as the chiral anomaly recently observed in condensed matter [2]. From a general viewpoint, wave or quantum systems possessing a gapped energy spectrum, such as band insulators, superconductors, or 2D conductors in a magnetic field, can be assigned topological invariants generally called Chern numbers [3]. These numbers control a variety of physical phenomena: for instance in the integer quantum Hall effect, they determine the value of the Hall conductance as a function of magnetic field [4,5] [22,[28][29][30] and exploited to implement topological pumping, a key concept of topology [22]. A paradigmatic example of quasicrystal is given by the 1D Fibonacci chain. It presents a fractal energy spectrum which consists of an infinite number of gaps [31]. A rather surprising and fascinating property is that each of theses gaps can also be assigned a topological number analogous to the aforementioned Chern numbers [32]: this constitutes the so-called gap-labeling theorem [33]. These integers can take N distinct values, N being the number of letters in the chain [34]. Despite important advances on the topological properties of quasicrystals [19][20][21][22][23][24][28][29][30]] the topological invariants have not yet been directly measured as winding numbers.The physical origin of topological numbers in a Fibonacci quasicrystal can be related to its structural properties [35]. To understand this, let us introduce a general method to generate a Fibonacci sequence: it is based on the characteristic functionproposed in [36], which takes two possible values ±1, respectively identified with two letters A and B representing e.g. two different values of a potential energy. A Fibonacci sequence of size N is a wordfor...