$\frac{1}{A_1A_2}=\frac{1}{A_1A_3}+\frac{1}{A_1A_4}$.Then find the value of $n$
If you know a bit about complex numbers and roots of unity, here is another approach:
The $n^\text{th}$ roots of unity are vertices of a regular $n$-gon. Let $z=1$ denote $A_1$ and $w = e^{\frac{2\pi\iota}{n}}$ denote $A_2$ in the complex plane. Then $w^2$ denotes $A_3$ and $w^3$ denotes $A_4$. Now, the given equation can be written as
$$\frac{1}{|1-w|} = \frac{1}{|1-w^2|} + \frac{1}{|1-w^3|}$$ Multiplying with $|1-w|$ throughout, we get $$1 = \frac{1}{|1+w|} + \frac{1}{|1+w+w^2|}$$
Now since $|w|=1$, pulling out $|w|$ from the denominator of the second term in the R.H.S, $$1 = \frac{1}{|1+w|} + \frac{1}{|1+w+\bar{w}|}$$ Notice that $w+\bar{w}$ is purely real and can be written $w+\frac{1}{w}$, hence $$1 - \frac{w}{1+w+w^2} = \frac{1+w^2}{1+w+w^2} = \frac{1}{|1+w|}$$ Squaring both sides and using $|z|^2 = z\bar{z}$, $$\Bigg(\frac{1+w^2}{1+w+w^2}\Bigg)^2 = \frac{1}{(1+w)} \cdot \frac{1}{(1+\frac{1}{w})}= \frac{w}{(1+w)^2}$$ Cross multiply, $$(1+w+w^2+w^3)^2 = w (1+w+w^2)^2$$ and simplify to get $$1+w+w^2+w^3+w^4+w^5+w^6 = 0$$ Therefore, $$1-w^7 =0$$ and $w \neq 1$, so $w$ must be a $7$th root of unity. Argue that $n =7$.
This problem can be trivialized by Ptolemy's theorem.
First we take the l.c.m and simplify both sides of the given equation. Let $A_1A_2=a$, $A_1A_3=b$, $A_1A_4=c$. Then we have
$$\frac{1}{a}=\frac{1}{b}+\frac{1}{c} \qquad\to\qquad b c = a b + a c \tag{1}$$
Now, note that regular polygons can always be inscribed in a circle. Take the quadrilateral $A_1A_3A_4A_5$, which is a cyclic quadrilateral. Applying Ptolemy's theorem we get, $$A_1A_3\cdot A_4A_5 + A_3A_4\cdot A_1A_5 = A_1A_4\cdot A_3A_5 \tag{2}$$ Now see that $A_1A_3=b$, $A_4A_5=a$, $A_3A_4=a$, $A_1A_4=c$, $A_3A_5=b$, so in $(2)$ we have, $$b a + a\cdot A_1A_5 = c b \tag{3}$$
Comparing equation $(1)$ with $(3)$, we see that $A_1A_5 = c = A_1A_4$. These are two diagonals of the regular polygon sharing a common vertex, so this diagonal must be a diagonal that bisects the area of the polygon. So on one side of the diagonal $A_1A_4$ there is $A_2$, $A_3$; and on the other side of the diagonal $A_1A_5$ there must be $A_6$, $A_7$. So there are 7 vertices of the polygon.
Hence $n=7$, leading to a heptagon.
$Outline:$
I'm sorry I cannot draw a diagram and explain, though that would be very neat. Let $r$ be the radius of the circumcircle, and let $2\theta$ be the angle subtended at the center by the adjacent vertices. If $a$ is the length of any side of the regular polygon, then $a = 2r\sin\theta$. Now $\theta = \frac{\pi}{n}$, then the given equation becomes $\frac{1}{\sin\theta} = \frac{1}{\sin2\theta} + \frac{1}{\sin3\theta}$. Simplify this, you will get $\sin4\theta = \sin3\theta$, gives $\theta = \frac{\pi}{7}$. So $n = 7$ is the final answer. You may fill in the gaps in the solution.
Since the answer got a few upvotes, I looked up a little bit more and found that this problem was asked in IIT JEE 1994 (entrance exam for Indian Institute of Technology) and again a variant of it in 2011. Prof K. D. Joshi, in his book Educative JEE, has outlined 3 solutions, one of them is like mine (only better), then the Ptolemy one given by user260674 as well as the one using complex numbers given by Seven. You can refer to page 18 and 19 of the original script here