Convexity of a Given Function Is the following function convex or concave?
$$f(\mathbf{x}) = \frac{1}{N}\sum_{i=1}^N\sqrt{1+\frac{x_i^2}{\left(\frac{1}{N}\sum_{i=1}^{N}x_i\right)^2}},$$
$\mathbf{x} = [x_1,x_2,...,x_N]^T, x_i \ge 0 \, \forall i $
What I know: $g(y_i) = \sqrt{1+y_i^2}$ is convex. Here, $y_i=\frac{x_i}{\frac{1}{N}\sum_{i=1}^Nx_i}$ and f(.) is obtained by linear transformations of g(.). Hence f(.) is convex in $y_i$. 
But what about f(.) in $x$? (Note that $y_i$ are non linear in $x_i$)
 A: Claim-1) A function $f(x),x\in \mathbb{R}^n$ defined as finite sum with positive weights $\sum_i \alpha_i f_i(x)$ will not be convex/concave if every $f_i(x)$ is not convex/concave at a point in the domain.
Claim-2) Let h be a concave function on some appropriate domain.  
$\qquad \qquad $ Now, $\quad$ g(x) is concave $\implies$ $h\circ g(x)$ is concave.  $\qquad \quad $
Claim-3) A function $f(x), x\in \mathbb{R}^n$ is convex, then f is convex in each sub-domain. Specifically, $f$ is convex in each element of the argument vector $x$.
All the three claims can be seen clearly from the basic definition of convexity i.e.,
$$f(\lambda x_1+(1-\lambda)x_2) \le \lambda f(x_1) + (1-\lambda) f(x_2), x_1,x_2 \in \mathbb{R}^n.  $$

Define $f = \frac{1}{N}\sum_i h\circ g_i$,$\hspace{3mm}$ with $h:R\to R,\ \ h(x)\triangleq \sqrt{x},\\ g_i:R^n \to R, \ \ g_i(x)\triangleq 1+ \frac{x_i^2}{\left(\frac{1}{N}\sum_{j=1}^{N}x_j\right)^2}$.

Define $D_i \triangleq \{ x\in \mathbb{R}^n : x_i \leq \frac{1}{2}\sum_{j\neq i} x_j \}$ and $E_i \triangleq \{ x\in \mathbb{R}^n : x_i \leq -\sum_{j\neq i} x_j \}$..
So, if we can prove that each $h\circ g_i$ is convex in a common-subdomain and concave in another common-subdomain, it suffices to show that $f$ is not convex/concave.

Consider the candidate function $p:R\to R$ as:
$$ p(x) \triangleq \frac{x^2}{(x+a)^2},\\ \implies p''(x) = \frac{2a^2-4ax}{(x+a)^4}, $$
$p(.)$ is concave in $[a/2,\infty)$ and is convex in $(-\infty,a/2]$. in other words, $p$ is neither convex nor concave function.
With the above analysis, we can conclude that $h\circ g_i (x)$ is convex in coordinate $x_i$ for every $x\in D_i$ and concave in the same coordinate at rest all points in $D_i^c$.

Now consider another candidate function $q:R\to R$ as:
$$ q(x) \triangleq \sqrt{1+ \frac{b}{(x+a)^2}}\\ \implies q''(x) = -3b(x+a) [b+(x+a)^2]^{-\frac{5}{2}}$$
We can conclude that $q(.)$ is convex in $(-\infty,-a]$ and concave in $(-a,\infty)$ or simply, $q$ is neither convex nor concave function.
From this analysis, we can conclude that $h\circ g_i$ is convex in coordinate $x_j, j\neq i$, for every $x\in E_i$ and concave in the same coordinate at the rest all points in $E_i^c$

Consider coordinate $x_1$.
$h\circ g_1$ is convex in coordinate $x_1,\ \ \forall x\in D_1$ and concave in coordinate $x_1,\ \ \forall x\in D_1^c$. 
Similarly $h\circ g_2, h\circ g_3,\ldots$ are convex in coordinate $x_1,\ \ \forall x\in E_2, E_3,\ldots $  and are concave in coordinate $x_1,\ \ \forall x\in E_2^c, E_3^c,\ldots $ respectively.
Now if $x\in D_1\cap E_2\cap E_3\ldots \cap E_n$, then $f$ is convex in coordinate $x_1$. 
Similarly if $x\in D_1^c\cap E_2^c\cap E_3^c\ldots \cap E_n^c$, then $f$ is concave in coordinate $x_1$.
Hence, $f$ is neither convex nor concave in one of its coordinates $x_1$, which suffices to say that f is neither convex nor concave, if we can prove that the above intersections are non-empty. [Somebody please complement that. $0\in abovetwo$, trivially]
