You know that for 0<a<1, f(ax+(1-a)y)<af(x)+(1-a)f(y).

Since f>0, you can square this inequality to obtain

f²(ax+(1-a)y)<a²f²(x)+(1-a)²f²(y)+2a(1-a)f(x)f(y).

Now remember that 2f(x)f(y)<f²(x)+f²(y) (because (f(x)-f(y))²>0 )

The inequality becomes

f²(ax+(1-a)y)<a²f²(x)+(1-a)²f²(y)+a(1-a)(f²(x)+f²(y))=f²(x)(a²+a-a²)+f²(y)((1-a)²+a(1-a))=

af²(x)+(1-a)f²(y)

and f² is convex by definition.

Note that if f is C², f convex <=> f''>0.

In this case you have a simpler proof

(f²)'=2ff': (f²)''=2f'2+2ff''>0.

(Note that I used < for

all over the place)