Q:

Extract output from FindMaximum inside a function

I have a function similar to this
 f[a_] := FindMaximum[{3 x, x < 1}, x]

which outputs
 {3., {x -> 1.}}

how do I change it so that the output is just the value that maximizes f (i.e. no lists, no arrows, just the real number)

A:

FindMaximum results in an output in the format of 

{fmax, {x -> xmax}}

If you only want the maximum value fmax, you can use FindMaxValue[] and if you only want xmax then you can use FindArgMax[].
In your case, the output of FindArgMax[] is a list that contains only one number. There are several ways to extract it. I used First:
First@FindArgMax[{3 x, x < 1}, x]

But why do you have it as a function of a? You don't have a in your function definition. 

A:

f[a_] := FindMaximum[{3 x, x < 1}, x][[2, 1, 2]]

