Solution ทั้ง 10 ข้อ (ภาษาอังกฤษนะครับ พอดีพิมพ์เก็บไว้แค่อังกฤษ)
Clearly $P$ is the projection from $B$ to $AC$ thus quadrilaterals $ABPE$ and $CBPD$ are cyclic. This implies that $PB=PD=PE$, completing (i).
For (ii), we just observe that
$$\angle CAE + \angle CDE = \angle PBE + (90^{\circ} + \angle BDE) = 180^{\circ}.$$
The main claim is
Claim: (Gcd bash) We have $\gcd(a^2-b^2, a(a^2+b^2))\mid 2$.
Proof: Let $d\mid a^2-b^2$ and $d\mid a(a^2+b^2)$. We get
\begin{align*}
d\mid a(a^2+b^2) + a(a^2-b^2) &\implies d\mid 2ab^2 \\
d\mid 2a(a^2+b^2) &\implies d\mid 2a^3 \\
d\mid a^2-b^2\mid 2(a^4-b^4) &\implies d\mid 2b^4
\end{align*}
thus $d\mid 2\gcd(a,b)^4=2$ so we are done.
By the claim, we get $a^2-b^2\mid 4$ which is a clear contradiction.
The answer is $f(x)=2\sqrt{x+c}$ for any constant $c\geqslant 0$. It's straightforward to verify that they are all work.
Now we present several solutions which show that these are all possible solutions.
Solution 1 (Substitution, Pitchayut): Plug in $(x,y) = \left(a, \frac{\sqrt{f(a)^2+4b}-f(a)}{2}\right)$ gives
$$f(a+b) = \sqrt{f(a)^2+4b} \implies f(a+b)^2=f(a)^2+4b$$
This is enough to conclude that $f(x)^2 = 4x+c$ for some constant $c$. This implies the set of solutions mentioned above.
Solution 2 (Squaring, Nithid): Squaring the entire equation gives
$$f(x+yf(x)+y^2)^2 = f(x)^2 + 4(yf(x)+y^2).$$
By Intermediate Value Theorem, function $g(y) := yf(x)+y^2$ is surjective on $\mathbb{R}^+$ as $\lim\limits_{y\to 0} g(y)=0$ and $\lim\limits_{y\to\infty} g(y)=\infty$. Thus we get
$$f(x+t)^2 = f(x)^2+4t$$
for any $x,t\in\mathbb{R}^+$. This is enough to conclude the solution.
Solution 3 (Injectivity): First, we prove that $f$ is injective. Suppose that $f(x+t)=f(x)$ for some $x,t\in\mathbb{R}^+$. Arguing as in above solutions, we can choose appropriate $y$ such that $yf(x)+y^2=t$. Using this choice of $x,y$ in the equation gives $y=0\implies t=0$ which is contradiction.
Now it's easy to finish. Plug in $y=\tfrac{f(t)}{2}$ gives
$$f\left(x+\frac{f(x)f(t)}{2} + \frac{f(t)^2}{4}\right) = f(x)+f(t) = f\left(t+\frac{f(x)f(t)}{2} + \frac{f(x)^2}{4}\right).$$
By injectivity, $4x+f(t)^2 = 4t+f(x)^2$ so we are done.
Solution 1 (Generating Function, Pitchayut): Consider the quantity
$$T = (x+x^2+x^3+...)+(y+y^2+y^3+...) = \frac{x}{1-x}+\frac{y}{1-y}$$
and define generating functions
$$F(x,y) = 1+T+T^2+...$$
It's clear that the coefficient of $x^ay^b$ in $F$ equals to the number of ways to jump with a total distance of $a+b$ and arrive at position $a-b$. (i.e. variable $x$ corresponds to positive jumps and variable $y$ corresponds to negative jumps).
Now we evaluate $F(x,y)$ in $\pmod 2$. To do this, let $G(x,y) = 1-T+T^2-T^3+...$ so that $G\equiv F\pmod 2$ and
$$G(x,y) = \frac{1}{1+T} = \frac{1}{1+\frac{x}{1-x}+\frac{y}{1-y}} = \frac{(1-x)(1-y)}{1-xy}$$
Thus, we have
$$G(x,y) = (1-x-y+xy)(1+(xy)+(xy)^2+(xy)^3+...)$$
It's clear that all odd coefficients are in form $x^ny^{n+1}$ and $x^{n+1}y^n$, which corresponds to $N(1)$ and $N(-1)$. Thus the answer is $\boxed{\{1,-1\}}$.
Solution 2 (Combinatorial, Official): Encode each positive jump by the corresponding number of $\texttt{+}$ and encode each negative jump by the corresponding number of $\texttt{-}$. We also seperate each jump by $\texttt{|}$. For instance,
$$\texttt{++|+++|---}\implies 0\stackrel{+2}{\longrightarrow} 2\stackrel{+3}{\longrightarrow} 5\stackrel{-3}{\longrightarrow} 2.$$
Clearly, in $N(a)$, we must have $\frac{2019+a}{2}$ $\texttt{+}$'s and $\frac{2019-a}{2}$ $\texttt{-}$'s. We also note that a $\texttt{|}$ must be inserted between $\texttt{+-}$.
Now, fix a sequence consisting many $\texttt{+}$ and $\texttt{-}$. Call a sequence \emph{bad} if and only if there are odd number of ways to insert $\texttt{|}$.
Claim: The only bad sequences are $\texttt{+-+-+...+}$ and $\texttt{-+-+-...-}$.
Proof: If $m,n$ denote the number of consecutive $\texttt{++}$ and $\texttt{--}$ respectively. Then clearly the number of ways to insert $\texttt{|}$ is precisely $2^{m+n}$. Thus the sequence is bad if and only if there are no $\texttt{++}$ and $\texttt{--}$ at all so we are done.
The two bad sequences correspond to $N(1)$ and $N(-1)$ thus the answer is $\{1,-1\}$.
Add one to each term and divide by $4$. This is equivalent to
$$\sum_{\mathrm{cyc}}\frac{b^2+b+a}{(2b+1)^2}\geqslant 1$$
Now we can use Cauchy Schwarz in form $(b^2+b+a)(1+b+\frac{1}{a})\geqslant (b+b+1)^2$. Thus it suffices to prove that
$$\sum_{\mathrm{cyc}}\frac{1}{b+\frac{1}{a}+1}\geqslant 1.$$
In fact, it turns out to be an equality. The cleanest way to verify that is to substitute $a=\frac{x}{y}, b=\frac{z}{x}, c=\frac{y}{z}$ and see that each term is equal to $\frac{x}{x+y+z}$.
The answer is only $f(x)=\tfrac{x}{2}$, which clearly works.
Define $g(x) = f(x)-\frac{x}{2}$. Then the given equation is equivalent to $xg(y)+yg(x)\leqslant 0$. We aim to show that $g\equiv 0$.
Plugging in $x=y$ gives $xg(x)\leqslant 0$. Thus plugging in $y=-x$ gives
$$xg(-x) + \underbrace{(-xg(x))}_{\geqslant 0} \leqslant 0\implies xg(-x)\leqslant 0$$
Replacing $x$ by $-x$ gives $xg(x)\geqslant 0$ for any $x\in\mathbb{R}$. This is enough to conclude that $g(x)=0$ for any $x\ne 0$.
Seeking $g(0)$, we just drop $x=0$ and we are done.
Clearly we can swap $f(k)$ and $f(-k)$ without any trouble. Thus WLOG $f(k) > f(-k)$ for any $k=1,2,...,2562$. The expression evaluates to
$$f(1)+f(2)+...+f(2562)-f(-1)-f(-2)-...-f(-2562).$$
Evidently it's minimized when $\{f(1),f(2),...,f(2562\}=\{1,2,...,2562\}$ and $\{f(-1),f(-2),...,f(-2562)\}=\{-1,-2,...,-2562\}$ which is basically the problem's condition.
Solution 1 (Spiral Similarity): Let the incircle touches $AC,AB$ at $E,F$. Then just notice the spiral similarity $\triangle KBF\stackrel{+}{\sim}\triangle KCE$ thus
$$\frac{KB}{KC}=\frac{BF}{CE}=\frac{BD}{DC}$$
or $KD$ bisects $\angle BKC$. This immediately implies $K,D,M$ are colinear.
Solution 2 (Inversion): Again, let $E,F$ be the other two intouch points. Perform inversion around the incircle. We deduce the following facts.
-$\triangle A'B'C'$ is medial triangle of $\triangle D'E'F'$.
-$I$ is orthocenter of $\triangle A'B'C'$.
-$M'$ is reflection of $I$ across $B'C'$.
-$K'$ is foot from $D'$ to $E'F'$.
This means points $\{K',D'\}$ and $\{I,M'\}$ are symmetric across $B'C'$. So $K'D'M'I$ is isosceles trapezoid which obviously cyclic. Inverting back, we find that $K,D,M$ are colinear.
The answer is $\boxed{4038}$.
To see the bound, note that each angle must be multiple of $\tfrac{\pi}{2019}$. Thus each angle has magnitude at most $\tfrac{2018\pi}{2019}$. Thus if the $n$-gon works, then
$$\pi(n-2)\leqslant \tfrac{2018\pi}{2019}\cdot n\implies n\leqslant 4038.$$
For the construction, take a regular $4038$-gon and draw a line connecting the center to each of the $4038$ vertices.
For each odd $n$, either $n$ or $n!-n$ works. To see why, let $n!+1=p$ be a prime. Then by a variant of Wilson's Theorem,
$$n!(p-1-n)!\equiv (-1)^{n-1}\pmod p\implies (n!-n)! = (p-1-n)!\equiv -1\pmod p$$
thus $p\mid (n!-n)!+1$ so $n!-n$ works.