Decomposing square of side length $n$ into $n$ squares in a certain "maximal" way
You get an upper bound of $n^{3/2}$ by applying Cauchy–Schwarz to the following relaxation of your program:
$$ \text{maximize} \quad \sum_{i=1}^n x_i \quad \text{subject to} \quad \sum_{i=1}^n x_i^2\leq n^2.$$
Explicitly, $\sum_{i=1}^n x_i=\langle x,1\rangle\leq\|x\|\|1\|\leq n\cdot n^{1/2}=n^{3/2}$.
For the other direction, the obvious feasible point gives a lower bound of $\lfloor\sqrt{n}\rfloor^3=(1−o(1))n^{3/2}$.
$f(8)=21$:
The other reported values up through $n=11$ are optimal. You can solve the problem via integer linear programming as follows. For square with top left corner $(i,j)$ and side length $s$, let binary decision variable $x_{i,j,s}$ indicate whether that square is used. The problem is to maximize $\sum_{i,j,s} s x_{i,j,s}$ subject to \begin{align} \sum_{i,j,s} x_{i,j,s} &= n \tag1 \\ \sum_{\substack{i,j,s:\\ i \le i_0 \le i+s-1 \\ j \le j_0 \le j+s-1}} x_{i,j,s} &\le 1 &&\text{for $(i_0,j_0)\in \{1,\dots,n\}\times \{1,\dots,n\}$} \tag2 \\ \end{align} Constraint $(1)$ forces $n$ squares to be used. Constraint $(2)$ prevents covering cell $(i_0,j_0)$ more than once.
Here are results for $n \le 50$, where $u_1(n)$ is the one-dimensional integer knapsack upper bound and $u_2(n)$ is the one-dimensional continuous knapsack upper bound: \begin{matrix} n & \lfloor \sqrt{n}\rfloor^3 & f(n) & u_1(n) & \lfloor u_2(n) \rfloor & u_2(n) & \lfloor n^{3/2} \rfloor \\ \hline 1 & 1 & 1 & 1 & 1 & 1 & 1 \\ 2 & 1 & 2 & 2 & 2 & 2.666666667 & 2 \\ 3 & 1 & 4 & 5 & 5 & 5 & 5 \\ 4 & 8 & 8 & 8 & 8 & 8 & 8 \\ 5 & 8 & 10 & 11 & 11 & 11 & 11 \\ 6 & 8 & 14 & 14 & 14 & 14.4 & 14 \\ 7 & 8 & 17 & 18 & 18 & 18.2 & 18 \\ 8 & 8 & 21 & 22 & 22 & 22.4 & 22 \\ 9 & 27 & 27 & 27 & 27 & 27 & 27 \\ 10 & 27 & 30 & 31 & 31 & 31.42857143 & 31 \\ 11 & 27 & 35 & 36 & 36 & 36.14285714 & 36 \\ 12 & 27 & 40 & 41 & 41 & 41.14285714 & 41 \\ 13 & 27 & 45 & 46 & 46 & 46.42857143 & 46 \\ 14 & 27 & 51 & 52 & 52 & 52 & 52 \\ 15 & 27 & 56 & 57 & 57 & 57.85714286 & 58 \\ 16 & 64 & 64 & 64 & 64 & 64 & 64 \\ 17 & 64 & 68 & 69 & 69 & 69.88888889 & 70 \\ 18 & 64 & 75 & 76 & 76 & 76 & 76 \\ 19 & 64 & 80 & 82 & 82 & 82.33333333 & 82 \\ 20 & 64 & 88 & 88 & 88 & 88.88888889 & 89 \\ 21 & 64 & 94 & 95 & 95 & 95.66666667 & 96 \\ 22 & 64 & 100 & 102 & 102 & 102.6666667 & 103 \\ 23 & 64 & 108 & 109 & 109 & 109.8888889 & 110 \\ 24 & 64 & 115 & 117 & 117 & 117.3333333 & 117 \\ 25 & 125 & 125 & 125 & 125 & 125 & 125 \\ 26 & 125 & 130 & 132 & 132 & 132.3636364 & 132 \\ 27 & 125 & 138 & 139 & 139 & 139.9090909 & 140 \\ 28 & 125 & 145 & 147 & 147 & 147.6363636 & 148 \\ 29 & 125 & 154 & 155 & 155 & 155.5454546 & 156 \\ 30 & 125 & 162 & 163 & 163 & 163.6363636 & 164 \\ 31 & 125 & 170 & 171 & 171 & 171.9090909 & 172 \\ 32 & 125 & 178 & 180 & 180 & 180.3636364 & 181 \\ 33 & 125 & 186 & 189 & 189 & 189 & 189 \\ 34 & 125 & 195 & 197 & 197 & 197.8181818 & 198 \\ 35 & 125 & 204 & 206 & 206 & 206.8181818 & 207 \\ 36 & 216 & 216 & 216 & 216 & 216 & 216 \\ 37 & 216 & 222 & 224 & 224 & 224.8461539 & 225 \\ 38 & 216 & 232 & 233 & 233 & 233.8461539 & 234 \\ 39 & 216 & 240 & 243 & 243 & 243 & 243 \\ 40 & 216 & 250 & 252 & 252 & 252.3076923 & 252 \\ 41 & 216 & 259 & 261 & 261 & 261.7692308 & 262 \\ 42 & 216 & 270 & 271 & 271 & 271.3846154 & 272 \\ 43 & 216 & 278 & 281 & 281 & 281.1538462 & 281 \\ 44 & 216 & 288 & 291 & 291 & 291.0769231 & 291 \\ 45 & 216 & 299 & 301 & 301 & 301.1538462 & 301 \\ 46 & 216 & 308 & 311 & 311 & 311.3846154 & 311 \\ 47 & 216 & 319 & 321 & 321 & 321.7692308 & 322 \\ 48 & 216 & 329 & 332 & 332 & 332.3076923 & 332 \\ 49 & 343 & 343 & 343 & 343 & 343 & 343 \\ 50 & 343 & 350 & 353 & 353 & 353.3333333 & 353 \\ \end{matrix}